haikuwebkit/LayoutTests/css3/parse-alignment-of-root-ele...

280 lines
15 KiB
HTML
Raw Permalink Normal View History

[CSS Box Alignment] New CSS Value 'normal' for Self Alignment https://bugs.webkit.org/show_bug.cgi?id=156254 Reviewed by Darin Adler. Source/WebCore: The Box Alignment specification defines a new value 'normal' to be used as default for the different layout models, which will define the specific behavior for each case. This patch adds a new CSS value in the parsing logic and adapts the Self Alignment properties to the new value. The 'auto' value is no longer valid for the 'align-items' property and the Computed Value will be always the specified value. Hence, I removed the StyleResolver logic because is not required now; the specific behavior of the 'normal' value will be resolved at layout time. Additionally, this patch updates the layout logic as well, for both Flexbox and Grid layout models. Test: css3/parse-alignment-of-root-elements.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::resolveLegacyJustifyItems): Added. (WebCore::resolveJustifyItemsAuto): Added. (WebCore::resolveJustifySelfAuto): Added. (WebCore::resolveAlignSelfAuto): Added. (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument. (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions. * css/CSSParser.cpp: (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'. (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'. * css/CSSPropertyNames.in: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword. * rendering/RenderBox.cpp: (WebCore::flexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::contentAlignmentNormalBehaviorFlexibleBox): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::alignChildren): * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentChangedToStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::contentAlignmentNormalBehaviorGrid): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::needToStretchChildLogicalHeight): (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::computeContentPositionAndDistributionOffset): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignItems): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifyItems): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function. LayoutTests: Changes in the already defined tests for the alignment properties to consider the new CSS value 'normal', which is the default for align-items and the value to resolve 'auto' when there is no parent. Added a new test to verify the Self-Alignment properties work as expected with root elements. * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/parse-align-items-expected.txt: * css3/parse-align-items.html: * css3/parse-align-self-expected.txt: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: Added. * css3/parse-alignment-of-root-elements.html: Added. * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/css/parse-justify-items-expected.txt: * fast/css/parse-justify-items.html: * fast/css/parse-justify-self-expected.txt: * fast/css/parse-justify-self.html: * fast/css/resources/alignment-parsing-utils.js: * svg/css/getComputedStyle-basic-expected.txt: (checkBadValues): * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/176298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-30 08:14:31 +00:00
<!DOCTYPE html>
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="resources/alignment-parsing-utils-th.js"></script>
[CSS Box Alignment] New CSS Value 'normal' for Self Alignment https://bugs.webkit.org/show_bug.cgi?id=156254 Reviewed by Darin Adler. Source/WebCore: The Box Alignment specification defines a new value 'normal' to be used as default for the different layout models, which will define the specific behavior for each case. This patch adds a new CSS value in the parsing logic and adapts the Self Alignment properties to the new value. The 'auto' value is no longer valid for the 'align-items' property and the Computed Value will be always the specified value. Hence, I removed the StyleResolver logic because is not required now; the specific behavior of the 'normal' value will be resolved at layout time. Additionally, this patch updates the layout logic as well, for both Flexbox and Grid layout models. Test: css3/parse-alignment-of-root-elements.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::resolveLegacyJustifyItems): Added. (WebCore::resolveJustifyItemsAuto): Added. (WebCore::resolveJustifySelfAuto): Added. (WebCore::resolveAlignSelfAuto): Added. (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument. (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions. * css/CSSParser.cpp: (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'. (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'. * css/CSSPropertyNames.in: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword. * rendering/RenderBox.cpp: (WebCore::flexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::contentAlignmentNormalBehaviorFlexibleBox): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::alignChildren): * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentChangedToStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::contentAlignmentNormalBehaviorGrid): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::needToStretchChildLogicalHeight): (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::computeContentPositionAndDistributionOffset): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignItems): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifyItems): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function. LayoutTests: Changes in the already defined tests for the alignment properties to consider the new CSS value 'normal', which is the default for align-items and the value to resolve 'auto' when there is no parent. Added a new test to verify the Self-Alignment properties work as expected with root elements. * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/parse-align-items-expected.txt: * css3/parse-align-items.html: * css3/parse-align-self-expected.txt: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: Added. * css3/parse-alignment-of-root-elements.html: Added. * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/css/parse-justify-items-expected.txt: * fast/css/parse-justify-items.html: * fast/css/parse-justify-self-expected.txt: * fast/css/parse-justify-self.html: * fast/css/resources/alignment-parsing-utils.js: * svg/css/getComputedStyle-basic-expected.txt: (checkBadValues): * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/176298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-30 08:14:31 +00:00
<html>
<body>
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
<p>Test to verify auto value resolution works as expected in root elements (eg. document root / shadow roots / slotted elements / elements inside slot)</p>
<div id="log"></div>
[CSS Box Alignment] New CSS Value 'normal' for Self Alignment https://bugs.webkit.org/show_bug.cgi?id=156254 Reviewed by Darin Adler. Source/WebCore: The Box Alignment specification defines a new value 'normal' to be used as default for the different layout models, which will define the specific behavior for each case. This patch adds a new CSS value in the parsing logic and adapts the Self Alignment properties to the new value. The 'auto' value is no longer valid for the 'align-items' property and the Computed Value will be always the specified value. Hence, I removed the StyleResolver logic because is not required now; the specific behavior of the 'normal' value will be resolved at layout time. Additionally, this patch updates the layout logic as well, for both Flexbox and Grid layout models. Test: css3/parse-alignment-of-root-elements.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::resolveLegacyJustifyItems): Added. (WebCore::resolveJustifyItemsAuto): Added. (WebCore::resolveJustifySelfAuto): Added. (WebCore::resolveAlignSelfAuto): Added. (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument. (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions. * css/CSSParser.cpp: (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'. (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'. * css/CSSPropertyNames.in: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword. * rendering/RenderBox.cpp: (WebCore::flexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::contentAlignmentNormalBehaviorFlexibleBox): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::alignChildren): * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentChangedToStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::contentAlignmentNormalBehaviorGrid): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::needToStretchChildLogicalHeight): (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::computeContentPositionAndDistributionOffset): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignItems): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifyItems): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function. LayoutTests: Changes in the already defined tests for the alignment properties to consider the new CSS value 'normal', which is the default for align-items and the value to resolve 'auto' when there is no parent. Added a new test to verify the Self-Alignment properties work as expected with root elements. * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/parse-align-items-expected.txt: * css3/parse-align-items.html: * css3/parse-align-self-expected.txt: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: Added. * css3/parse-alignment-of-root-elements.html: Added. * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/css/parse-justify-items-expected.txt: * fast/css/parse-justify-items.html: * fast/css/parse-justify-self-expected.txt: * fast/css/parse-justify-self.html: * fast/css/resources/alignment-parsing-utils.js: * svg/css/getComputedStyle-basic-expected.txt: (checkBadValues): * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/176298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-30 08:14:31 +00:00
<div id="host">
<div id="slotted" slot="s1"></div>
</div>
<script>
var block = document.getElementById("host");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
console.log("");
console.log("*** Test 'auto' value resolution for the document root node. ***");
test(function() {
document.documentElement.style.alignSelf = "center";
checkValues(document.documentElement, "alignSelf", "align-self", "center", "center");
document.documentElement.style.alignSelf = "auto";
checkValues(document.documentElement, "alignSelf", "align-self", "auto", "auto");
}, "Check out how the DOM's root element resolves the align-self 'auto' values.");
test(function() {
document.documentElement.style.alignItems = "center";
checkValues(document.documentElement, "alignItems", "align-items", "center", "center");
document.body.style.alignItems = "auto"; // The 'auto' value is not valid for align-items.
document.body.style.alignSelf = "auto";
checkValues(document.body, "alignItems", "align-items", "", "normal");
checkValues(document.body, "alignSelf", "align-self", "auto", "auto");
block.style.alignItems = ""; // Default value is 'normal' for align-items.
block.style.alignSelf = "auto";
checkValues(block, "alignItems", "align-items", "", "normal");
checkValues(block, "alignSelf", "align-self", "auto", "auto");
}, "Check out how the DOM's root element align-items's value is used to resolve its children's align-self 'auto' values.");
test(function() {
document.documentElement.style.alignItems = "auto"; // The 'auto' value is not valid for align-items.
checkValues(document.documentElement, "alignItems", "align-items", "center", "center");
document.documentElement.style.alignItems = ""; // Default value is 'normal' for align-items.
checkValues(document.documentElement, "alignItems", "align-items", "", "normal");
}, "Check out how the DOM's root element deals with 'auto' value in align-items.");
test(function() {
document.documentElement.style.justifySelf = "left";
checkValues(document.documentElement, "justifySelf", "justify-self", "left", "left");
document.documentElement.style.justifySelf = "auto";
checkValues(document.documentElement, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how the DOM's root element resolves the justify-self 'auto' values.");
test(function() {
console.log();
document.documentElement.style.justifyItems = "center";
checkValues(document.documentElement, "justifyItems", "justify-items", "center", "center");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
document.body.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
document.body.style.justifySelf = "auto";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(document.body, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(document.body, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
block.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
block.style.justifySelf = "auto";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(block, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(block, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how the DOM's root element justify-items's value is used to resolve its children's justify-self 'auto' values.");
test(function() {
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
document.documentElement.style.justifyItems = "legacy";
checkValues(document.documentElement, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(document.body, "justifySelf", "justify-self", "auto", "auto");
checkValues(block, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how the DOM's root element deals with 'auto' value in justify-items.");
test(function() {
document.documentElement.style.justifyItems = "legacy center";
checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
document.body.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
document.body.style.justifySelf = "auto";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(document.body, "justifyItems", "justify-items", "legacy", "legacy center");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(document.body, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
block.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
block.style.justifySelf = "auto";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(block, "justifyItems", "justify-items", "legacy", "legacy center");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(block, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how the DOM's root element justify-items's value with 'legacy' keyword is used to resolve any descendant's justify-items 'auto' values.");
test(function() {
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
document.documentElement.style.justifyItems = "legacy";
checkValues(document.body, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(document.body, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(block, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(block, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how the DOM's root element recomputes its descendant's style when 'legacy' keyword is removed from its justify-items value.");
console.log("");
console.log("*** Test 'auto' value resolution for the shadow DOM root node. ***");
var shadowHost = document.getElementById("host")
var shadowRoot = shadowHost.attachShadow({mode:"open"});
var shadowNode = document.createElement('div');
shadowRoot.appendChild(shadowNode);
console.log("");
console.log();
test(function() {
shadowHost.style.alignItems = "center";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.alignItems = "end";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(shadowHost, "alignItems", "align-items", "center", "center");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowNode, "alignItems", "align-items", "end", "end");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
shadowNode.style.alignItems = "";
checkValues(shadowNode, "alignItems", "align-items", "", "normal");
shadowNode.style.alignSelf = "auto";
checkValues(shadowNode, "alignSelf", "align-self", "auto", "auto");
}, "Shadow Node inherits from ShadowHost to resolve the 'auto' values for align-self.");
test(function() {
shadowHost.style.justifyItems = "center";
shadowNode.style.justifyItems = "right";
checkValues(shadowHost, "justifyItems", "justify-items", "center", "center");
checkValues(shadowNode, "justifyItems", "justify-items", "right", "right");
shadowNode.style.justifyItems = "";
checkValues(shadowNode, "justifyItems", "justify-items", "", "normal");
shadowNode.style.justifySelf = "auto";
checkValues(shadowNode, "justifySelf", "justify-self", "auto", "auto");
}, "Shadow Node inherits from ShadowHost to resolve the 'auto' values for justify-self.");
test(function() {
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowHost.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
shadowNode.style.justifyItems = "right";
shadowNode.style.justifySelf = "auto";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(shadowNode, "justifyItems", "justify-items", "right", "right");
checkValues(shadowNode, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
document.documentElement.style.justifyItems = "legacy center";
checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "legacy center");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(shadowNode, "justifyItems", "justify-items", "right", "right");
checkValues(shadowNode, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.justifyItems = "legacy";
checkValues(shadowNode, "justifyItems", "justify-items", "legacy", "legacy center");
document.documentElement.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
}, "Check out how the 'legacy' keyword in justify-items propagates from the DOM Tree to the Shadow Node.");
console.log("");
console.log("*** Test 'auto' value resolution for the shadow DOM 'slotted' elements. ***");
var slotted = document.getElementById("slotted");
test(function() {
shadowHost.style.alignItems = "center";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.alignItems = "start";
slotted.style.alignItems = "end";
checkValues(slotted, "alignItems", "align-items", "end", "end");
slotted.style.alignItems = "";
checkValues(slotted, "alignItems", "align-items", "", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slotted.style.alignSelf = "start";
checkValues(slotted, "alignSelf", "align-self", "start", "start");
slotted.style.alignSelf = "auto";
checkValues(slotted, "alignSelf", "align-self", "auto", "auto");
}, "Check out how align-self uses the 'shadowHost' as 'slotted' element's parent while 'slot' is not assigned.");
test(function() {
shadowHost.style.justifyItems = "center";
shadowNode.style.justifyItems = "right";
slotted.style.justifyItems = "left";
checkValues(slotted, "justifyItems", "justify-items", "left", "left");
slotted.style.justifyItems = "";
checkValues(slotted, "justifyItems", "justify-items", "", "normal");
slotted.style.justifySelf = "start";
checkValues(slotted, "justifySelf", "justify-self", "start", "start");
slotted.style.justifySelf = "auto";
checkValues(slotted, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how justify-self uses the 'shadowHost' as 'slotted' element's parent while 'slot' is not assigned.");
test(function() {
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowHost.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
shadowNode.style.justifyItems = "right";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(shadowNode, "justifyItems", "justify-items", "right", "right");
document.documentElement.style.justifyItems = "legacy center";
checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "legacy center");
slotted.style.justifyItems = "legacy";
checkValues(slotted, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slotted.style.justifySelf = "auto";
checkValues(slotted, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.justifyItems = "legacy";
checkValues(shadowNode, "justifyItems", "justify-items", "legacy", "legacy center");
checkValues(slotted, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(slotted, "justifySelf", "justify-self", "auto", "auto");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
document.documentElement.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
}, "Check out how the 'legacy' keyword in justify-items affects the 'slotted' elements while 'slot' is not assigned.");
// Slot element is assigned now.
var slot = document.createElement('slot');
slot.setAttribute('name', 's1');
shadowNode.appendChild(slot);
test(function() {
shadowHost.style.alignItems = "center";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.alignItems = "end";
slotted.style.alignItems = "start";
checkValues(slotted, "alignItems", "align-items", "start", "start");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slotted.style.alignItems = "";
checkValues(slotted, "alignItems", "align-items", "", "normal");
slotted.style.alignSelf = "start";
checkValues(slotted, "alignSelf", "align-self", "start", "start");
slotted.style.alignSelf = "auto";
checkValues(slotted, "alignSelf", "align-self", "auto", "auto");
}, "Check out how align-self uses the 'slot' element's parent (Shadow Node) as 'slotted' element' s parent after the 'slot' is assigned.");
test(function() {
shadowHost.style.justifyItems = "center";
shadowNode.style.justifyItems = "right";
slotted.style.justifyItems = "left";
checkValues(slotted, "justifyItems", "justify-items", "left", "left");
slotted.style.justifyItems = "";
checkValues(slotted, "justifyItems", "justify-items", "", "normal");
slotted.style.justifySelf = "start";
checkValues(slotted, "justifySelf", "justify-self", "start", "start");
slotted.style.justifySelf = "auto";
checkValues(slotted, "justifySelf", "justify-self", "auto", "auto");
}, "Check out how justify-self uses the 'slot' element's parent (Shadow Node) as 'slotted' element' s parent after the 'slot' is assigned.");
test(function() {
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowHost.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
shadowNode.style.justifyItems = "right";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(shadowNode, "justifyItems", "justify-items", "right", "right");
document.documentElement.style.justifyItems = "legacy center";
checkValues(document.documentElement, "justifyItems", "justify-items", "legacy center", "legacy center");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
checkValues(shadowHost, "justifyItems", "justify-items", "legacy", "legacy center");
slotted.style.justifyItems = "legacy";
checkValues(slotted, "justifyItems", "justify-items", "legacy", "normal"); // Shadow host is not the parent now, but ShadowNode.
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slotted.style.justifySelf = "auto";
checkValues(slotted, "justifySelf", "justify-self", "auto", "auto"); // Shadow host is not the parent now, but ShadowNode.
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.justifyItems = "legacy";
checkValues(shadowNode, "justifyItems", "justify-items", "legacy", "legacy center");
checkValues(slotted, "justifyItems", "justify-items", "legacy", "legacy center"); // Now that shadowNode is auto, 'legacy' applies.
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
checkValues(slotted, "justifySelf", "justify-self", "auto", "auto"); // Now that shadowNode is auto, 'legacy' applies.
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
document.documentElement.style.justifyItems = "legacy";
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
}, "Check out how the 'legacy' keyword affects the 'slotted' elements after the 'slot' is assigned.");
test(function() {
shadowHost.style.alignItems = "center";
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
shadowNode.style.alignItems = "end";
slot.style.alignItems = "start";
checkValues(slot, "alignItems", "align-items", "start", "start");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slot.style.alignItems = "";
checkValues(slot, "alignItems", "align-items", "", "normal");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
slot.style.alignSelf = "start";
checkValues(slot, "alignSelf", "align-self", "start", "start");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slot.style.alignSelf = "auto";
checkValues(slot, "alignSelf", "align-self", "auto", "auto");
}, "The 'slot' element should not use its parent inside the ShadowDOM tree to resolve the align-self 'auto' values because Blink does not support slots in the flat tree.");
test(function() {
shadowHost.style.justifyItems = "center";
shadowNode.style.justifyItems = "right";
slot.style.justifyItems = "left";
checkValues(slot, "justifyItems", "justify-items", "left", "left");
[css-align] Implement the new behavior of 'legacy' for justify-items https://bugs.webkit.org/show_bug.cgi?id=172712 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Rebaselined Default Alignment related tests because of the new 'legacy' value. * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt: * web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002-expected.txt: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html: * web-platform-tests/css/css-align/default-alignment/parse-justify-items-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004-expected.txt: * web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html: Source/WebCore: The syntax of the 'justify-items' property accepts a new 'legacy' value, replacing the 'auto' value which is now parsed as invalid. https://github.com/w3c/csswg-drafts/issues/1318 This change affects also to the 'place-items' shorthand, which doesn't accept 'auto' and, for the time being, neither 'legacy'. Since the new value 'legacy' is also the default value, I don't expect this change to break content of sites currently using the 'justify-items' property. No new tests, rebaselined existing test. * css/CSSComputedStyleDeclaration.cpp: (WebCore::valueForItemPositionWithOverflowAlignment): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ItemPosition const): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): * css/parser/CSSPropertyParser.cpp: (WebCore::isAuto): (WebCore::isNormalOrStretch): (WebCore::consumeSelfPositionOverflowPosition): (WebCore::consumeJustifyItems): (WebCore::consumeSimplifiedDefaultPosition): (WebCore::consumeSimplifiedSelfPosition): (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): * rendering/RenderFlexibleBox.cpp: (WebCore::alignmentOffset): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedJustifyItems const): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::initialJustifyItems): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): LayoutTests: Rebaselined Default Alignment related tests because of the new 'legacy' value. * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * fast/css/parse-justify-items.html: Canonical link: https://commits.webkit.org/198450@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228319 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 14:57:12 +00:00
slot.style.justifyItems = "legacy";
checkValues(slot, "justifyItems", "justify-items", "legacy", "normal");
[css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved https://bugs.webkit.org/show_bug.cgi?id=172707 Reviewed by Antti Koivisto. LayoutTests/imported/w3c: This change makes all the cases of the test below to pass now, hence updated expectations accordingly. * web-platform-tests/css/css-align-3/self-alignment/place-self-shorthand-006-expected.txt: Source/WebCore: The CSS Box Alignment specification has been changed recently so that now all the propeties have the specificed value as computed value. The rationale of this change are at the associated W3C github issue [1]. This change implies that we don't need to execute the StyleAdjuter logic we implemented specifically for supporting 'auto' values resolution for computed style. We can live now with resolution at layout time only. [1] https://github.com/w3c/csswg-drafts/issues/440 No new tests, just updating the already defined tests. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::propertyValue): * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): Removed * css/StyleResolver.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * rendering/RenderBox.cpp: (WebCore::RenderBox::columnFlexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): Added (WebCore::RenderFlexibleBox::alignmentForChild): * rendering/RenderFlexibleBox.h: LayoutTests: Updated layout tests so that resolved value is as specified, even for 'auto' values. * TestExpectations: * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled-expected.txt: * css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: * css3/parse-alignment-of-root-elements.html: * css3/parse-place-items.html: * css3/parse-place-self.html: * fast/css/ensure-flexbox-compatibility-with-initial-values-expected.txt: * fast/css/parse-justify-self.html: Canonical link: https://commits.webkit.org/191158@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-07-10 23:56:21 +00:00
slot.style.justifySelf = "left";
checkValues(slot, "justifySelf", "justify-self", "left", "left");
slot.style.justifySelf = "auto";
checkValues(slot, "justifySelf", "justify-self", "auto", "auto");
}, "The 'slot' element should not use its parent inside the ShadowDOM tree to resolve the justify-self 'auto' values because Blink does not support slots in the flat tree.");
[CSS Box Alignment] New CSS Value 'normal' for Self Alignment https://bugs.webkit.org/show_bug.cgi?id=156254 Reviewed by Darin Adler. Source/WebCore: The Box Alignment specification defines a new value 'normal' to be used as default for the different layout models, which will define the specific behavior for each case. This patch adds a new CSS value in the parsing logic and adapts the Self Alignment properties to the new value. The 'auto' value is no longer valid for the 'align-items' property and the Computed Value will be always the specified value. Hence, I removed the StyleResolver logic because is not required now; the specific behavior of the 'normal' value will be resolved at layout time. Additionally, this patch updates the layout logic as well, for both Flexbox and Grid layout models. Test: css3/parse-alignment-of-root-elements.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::resolveLegacyJustifyItems): Added. (WebCore::resolveJustifyItemsAuto): Added. (WebCore::resolveJustifySelfAuto): Added. (WebCore::resolveAlignSelfAuto): Added. (WebCore::valueForItemPositionWithOverflowAlignment): Using a StyleSelfAlignmentData argument. (WebCore::ComputedStyleExtractor::propertyValue): Using the new resolving functions. * css/CSSParser.cpp: (WebCore::CSSParser::parseItemPositionOverflowPosition): A new value 'normal' is now valid. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Mappings for the new value 'normal'. (WebCore::CSSPrimitiveValue::operator ItemPosition): Mappings for the new value 'normal'. * css/CSSPropertyNames.in: * css/StyleResolver.cpp: (WebCore::StyleResolver::adjustRenderStyle): We don't need to resolve 'legacy" keyword. * rendering/RenderBox.cpp: (WebCore::flexItemHasStretchAlignment): (WebCore::RenderBox::hasStretchedLogicalWidth): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::styleDidChange): (WebCore::RenderFlexibleBox::alignmentForChild): (WebCore::contentAlignmentNormalBehaviorFlexibleBox): (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): (WebCore::RenderFlexibleBox::layoutColumnReverse): (WebCore::RenderFlexibleBox::alignFlexLines): (WebCore::RenderFlexibleBox::alignChildren): * rendering/RenderGrid.cpp: (WebCore::defaultAlignmentChangedToStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInRowAxis): (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): (WebCore::selfAlignmentChangedToStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInRowAxis): (WebCore::selfAlignmentChangedFromStretchInColumnAxis): (WebCore::contentAlignmentNormalBehaviorGrid): (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): (WebCore::RenderGrid::needToStretchChildLogicalHeight): (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded): (WebCore::RenderGrid::columnAxisPositionForChild): (WebCore::RenderGrid::rowAxisPositionForChild): (WebCore::RenderGrid::columnAxisOffsetForChild): (WebCore::RenderGrid::rowAxisOffsetForChild): (WebCore::RenderGrid::computeContentPositionAndDistributionOffset): * rendering/style/RenderStyle.cpp: (WebCore::resolvedSelfAlignment): (WebCore::RenderStyle::resolvedAlignItems): (WebCore::RenderStyle::resolvedAlignSelf): (WebCore::RenderStyle::resolvedJustifyItems): (WebCore::RenderStyle::resolvedJustifySelf): * rendering/style/RenderStyle.h: * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): align-items uses now a different initial function. LayoutTests: Changes in the already defined tests for the alignment properties to consider the new CSS value 'normal', which is the default for align-items and the value to resolve 'auto' when there is no parent. Added a new test to verify the Self-Alignment properties work as expected with root elements. * css3/flexbox/css-properties-expected.txt: * css3/flexbox/css-properties.html: * css3/parse-align-items-expected.txt: * css3/parse-align-items.html: * css3/parse-align-self-expected.txt: * css3/parse-align-self.html: * css3/parse-alignment-of-root-elements-expected.txt: Added. * css3/parse-alignment-of-root-elements.html: Added. * fast/css/getComputedStyle/computed-style-expected.txt: * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: * fast/css/parse-justify-items-expected.txt: * fast/css/parse-justify-items.html: * fast/css/parse-justify-self-expected.txt: * fast/css/parse-justify-self.html: * fast/css/resources/alignment-parsing-utils.js: * svg/css/getComputedStyle-basic-expected.txt: (checkBadValues): * svg/css/getComputedStyle-basic-expected.txt: Canonical link: https://commits.webkit.org/176298@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-05-30 08:14:31 +00:00
</script>
</body>
</html>