haikuwebkit/LayoutTests/css3/parse-place-items.html

263 lines
10 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE html>
<html>
<head>
<style>
#placeItemsNormal {
place-items: normal;
}
#placeItemsBaseline {
place-items: baseline;
}
#placeItemsFirstBaseline {
place-items: first baseline;
}
#placeItemsLastBaseline {
place-items: last baseline;
}
#placeItemsStart {
place-items: start;
}
#placeItemsFlexStart {
place-items: flex-start;
}
#placeItemsEnd {
place-items: end;
}
#placeItemsSelfStart {
place-items: self-start;
}
#placeItemsStretch {
place-items: stretch;
}
#placeItemsStartEnd {
place-items: start end;
}
#placeItemsStartSelfEnd {
place-items: start self-end;
}
#placeItemsStartBaseline {
place-items: start baseline;
}
<!-- Invalid CSS cases -->
#placeItemsEmpty {
place-items:;
}
#placeItemsAuto {
place-items: 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
#placeItemsCenterAuto {
place-items: center auto;
}
#placeItemsNone {
place-items: none;
}
#placeItemsSafe {
place-items: safe;
}
#placeItemsStartSafe {
place-items: start safe;
}
#placeItemsBaselineSafe {
place-items: baseline safe;
}
#placeItemsStartEndLeft {
place-items: start end left;
}
</style>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="resources/alignment-parsing-utils-th.js"></script>
</head>
<body>
<p>Test to verify that the new place-items alignment shorthand is parsed as expected and correctly sets the longhand values.</p>
<div id="log"></div>
<div id="placeItemsNormal"></div>
<div id="placeItemsBaseline"></div>
<div id="placeItemsFirstBaseline"></div>
<div id="placeItemsLastBaseline"></div>
<div id="placeItemsStart"></div>
<div id="placeItemsFlexStart"></div>
<div id="placeItemsEnd"></div>
<div id="placeItemsSelfStart"></div>
<div id="placeItemsStretch"></div>
<div id="placeItemsStartEnd"></div>
<div id="placeItemsStartSelfEnd"></div>
<div id="placeItemsStartBaseline"></div>
<div id="placeItemsEmpty"></div>
<div id="placeItemsAuto"></div>
[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
<div id="placeItemsCenterAuto"></div>
<div id="placeItemsNone"></div>
<div id="placeItemsSafe"></div>
<div id="placeItemsStartSafe"></div>
<div id="placeItemsBaselineSafe"></div>
<div id="placeItemsStartEndLeft"></div>
<script>
function checkPlaceItemsValues(element, value, alignValue, justifyValue) {
var res = value.split(" ");
if (res.length < 2)
res[1] = res[0];
checkValues(element, "alignItems", "align-items", res[0], alignValue);
checkValues(element, "justifyItems", "justify-items", res[1], justifyValue);
}
function checkPlaceItemsValuesJS(value, alignValue, justifyValue)
{
element = document.createElement("div");
document.body.appendChild(element);
element.style.placeItems = value;
checkValues(element, "placeItems", "place-items", value, alignValue + ' ' + justifyValue)
checkPlaceItemsValues(element, value, alignValue, justifyValue)
}
function checkPlaceItemsValuesBadJS(value)
{
element.style.placeItems = "";
element.style.placeItems = value;
checkPlaceItemsValues(element, "", "normal", "normal")
}
test(function() {
checkValues(placeItemsNormal, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsNormal, "", "normal", "normal");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'normal' value through CSS.");
test(function() {
checkValues(placeItemsBaseline, "placeItems", "place-items", "", "baseline baseline");
checkPlaceItemsValues(placeItemsBaseline, "", "baseline", "baseline");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'baseline' value through CSS.");
test(function() {
checkValues(placeItemsFirstBaseline, "placeItems", "place-items", "", "baseline baseline");
checkPlaceItemsValues(placeItemsFirstBaseline, "", "baseline", "baseline");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'first baseline' value through CSS.");
test(function() {
checkValues(placeItemsLastBaseline, "placeItems", "place-items", "", "last baseline last baseline");
checkPlaceItemsValues(placeItemsLastBaseline, "", "last baseline", "last baseline");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'last baseline' value through CSS.");
test(function() {
checkValues(placeItemsStart, "placeItems", "place-items", "", "start start");
checkPlaceItemsValues(placeItemsStart, "", "start", "start");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'start' value through CSS.");
test(function() {
checkValues(placeItemsFlexStart, "placeItems", "place-items", "", "flex-start flex-start");
checkPlaceItemsValues(placeItemsFlexStart, "", "flex-start", "flex-start");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'flex-start' value through CSS.");
test(function() {
checkValues(placeItemsEnd, "placeItems", "place-items", "", "end end");
checkPlaceItemsValues(placeItemsEnd, "", "end", "end");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'end' value through CSS.");
test(function() {
checkValues(placeItemsSelfStart, "placeItems", "place-items", "", "self-start self-start");
checkPlaceItemsValues(placeItemsSelfStart, "", "self-start", "self-start");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'self-start' value through CSS.");
test(function() {
checkValues(placeItemsStretch, "placeItems", "place-items", "", "stretch stretch");
checkPlaceItemsValues(placeItemsStretch, "", "stretch", "stretch");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'stretch' value through CSS.");
test(function() {
checkValues(placeItemsStartEnd, "placeItems", "place-items", "", "start end");
checkPlaceItemsValues(placeItemsStartEnd, "", "start", "end");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'start end' value through CSS.");
test(function() {
checkValues(placeItemsStartSelfEnd, "placeItems", "place-items", "", "start self-end");
checkPlaceItemsValues(placeItemsStartSelfEnd, "", "start", "self-end");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'start self-end' value through CSS.");
test(function() {
checkValues(placeItemsStartBaseline, "placeItems", "place-items", "", "start baseline");
checkPlaceItemsValues(placeItemsStartBaseline, "", "start", "baseline");
}, "Test getting the Computed Value of place-items's longhand properties when setting 'start baseline' value through CSS.");
test(function() {
checkValues(placeItemsAuto, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsAuto, "", "normal", "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
}, "Test setting 'auto' as incorrect value through CSS.");
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
checkValues(placeItemsCenterAuto, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsCenterAuto, "", "normal", "normal");
}, "Test setting 'center auto' as incorrect value through CSS.");
test(function() {
checkValues(placeItemsNone, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsNone, "", "normal", "normal");
}, "Test setting 'none' as incorrect value through CSS.");
test(function() {
checkValues(placeItemsSafe, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsSafe, "", "normal", "normal");
}, "Test setting 'safe' as incorrect value through CSS.");
test(function() {
checkValues(placeItemsStartSafe, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsStartSafe, "", "normal", "normal");
}, "Test setting 'start safe' as incorrect value through CSS.");
test(function() {
checkValues(placeItemsBaselineSafe, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsBaselineSafe, "", "normal", "normal");
}, "Test setting 'baseline safe' as incorrect value through CSS.");
test(function() {
checkValues(placeItemsStartEndLeft, "placeItems", "place-items", "", "normal normal");
checkPlaceItemsValues(placeItemsStartEndLeft, "", "normal", "normal");
}, "Test setting 'start end left' as incorrect value through CSS.");
test(function() {
checkPlaceItemsValuesJS("center", "center", "center");
checkPlaceItemsValuesJS("center start", "center", "start");
checkPlaceItemsValuesJS("self-start end", "self-start", "end");
checkPlaceItemsValuesJS("normal end", "normal", "end");
}, "Test setting values through JS.");
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
checkPlaceItemsValuesBadJS("auto");
[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
checkPlaceItemsValuesBadJS("auto 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
checkPlaceItemsValuesBadJS("center auto");
checkPlaceItemsValuesBadJS("legacy");
checkPlaceItemsValuesBadJS("left 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
checkPlaceItemsValuesBadJS("space-between");
checkPlaceItemsValuesBadJS("center safe");
checkPlaceItemsValuesBadJS("center self-start center");
checkPlaceItemsValuesBadJS("asrt", "normal");
checkPlaceItemsValuesBadJS("auto", "normal");
checkPlaceItemsValuesBadJS("10px", "normal");
checkPlaceItemsValuesBadJS("stretch safe");
checkPlaceItemsValuesBadJS("self-start start end");
checkPlaceItemsValuesBadJS("");
}, "Test setting incorrect values through JS.");
test(function() {
element = document.createElement("div");
document.body.appendChild(element);
checkValues(element, "placeItems", "place-items", "", "normal normal");
element.style.placeItems = "center";
checkPlaceItemsValues(element, "center", "center", "center");
element.style.placeItems = "initial";
checkValues(element, "placeItems", "place-items", "initial", "normal normal");
checkPlaceItemsValues(element, "initial", "normal", "normal");
}, "Test the 'initial' value of the place-items shorthand and its longhand properties' Computed value");
test(function() {
document.body.style.placeItems = "start";
var anotherElement = document.createElement("div");
document.body.appendChild(anotherElement);
checkPlaceItemsValues(anotherElement, "", "normal", "normal");
anotherElement.style.placeItems = "inherit";
checkPlaceItemsValues(anotherElement, "inherit", "start", "start");
}, "Test the 'inherit' value of the place-items shorthand and its longhand properties' Computed value");
</script>
</body>
</html>