Log Message
[css-grid] Update <fixed-size> syntax https://bugs.webkit.org/show_bug.cgi?id=158063
Reviewed by Darin Adler.
Source/WebCore:
The syntax for <fixed-size> has been updated on the spec:
https://drafts.csswg.org/css-grid/#typedef-fixed-size
New syntax is:
<fixed-size> =
<fixed-breadth> |
minmax( <fixed-breadth> , <track-breadth> ) |
minmax( <inflexible-breadth> , <fixed-breadth> )
This means that it's enough to have one <fixed-breadth>,
it doesn't matter if it's as minimum or maximum.
Before it was required that the minimum was fixed.
* css/CSSParser.cpp:
(WebCore::isGridTrackFixedSized):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount):
LayoutTests:
Updated test to check the new expected behavior.
* fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt:
* fast/css-grid-layout/grid-element-auto-repeat-get-set.html:
Modified Paths
- trunk/LayoutTests/ChangeLog
- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt
- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html
- trunk/Source/WebCore/ChangeLog
- trunk/Source/WebCore/css/CSSParser.cpp
- trunk/Source/WebCore/rendering/RenderGrid.cpp
Diff
Modified: trunk/LayoutTests/ChangeLog (201398 => 201399)
--- trunk/LayoutTests/ChangeLog 2016-05-25 19:49:46 UTC (rev 201398)
+++ trunk/LayoutTests/ChangeLog 2016-05-25 19:52:53 UTC (rev 201399)
@@ -1,3 +1,15 @@
+2016-05-25 Manuel Rego Casasnovas <[email protected]>
+
+ [css-grid] Update <fixed-size> syntax
+ https://bugs.webkit.org/show_bug.cgi?id=158063
+
+ Reviewed by Darin Adler.
+
+ Updated test to check the new expected behavior.
+
+ * fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt:
+ * fast/css-grid-layout/grid-element-auto-repeat-get-set.html:
+
2016-05-25 Zalan Bujtas <[email protected]>
Swap search field's cancel and result button for RTL content.
Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt (201398 => 201399)
--- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt 2016-05-25 19:49:46 UTC (rev 201398)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt 2016-05-25 19:52:53 UTC (rev 201399)
@@ -15,7 +15,7 @@
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "100px 100px 100px 250px 250px"
PASS element.style.gridTemplateColumns is "repeat(auto-fill, minmax(50px, 100px)) 250px 250px"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "450px 50px [bar] 50px [bar foo] 10px [foo] 10px"
-PASS element.style.gridTemplateRows is "450px repeat(auto-fill, minmax(5em, -webkit-max-content) [bar]) [foo] 1em [foo] 1em"
+PASS element.style.gridTemplateRows is "450px repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) [foo] 1em [foo] 1em"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[start] 80px [foo bar] 200px [foo bar] 200px [foo bar] 200px [end]"
PASS element.style.gridTemplateColumns is "[start] 10% repeat(auto-fill, [foo bar] 200px) [end]"
PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "75px [prev] 200px [foo bar next] 150px [last end]"
@@ -56,8 +56,6 @@
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
-PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
-PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html (201398 => 201399)
--- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html 2016-05-25 19:49:46 UTC (rev 201398)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html 2016-05-25 19:52:53 UTC (rev 201399)
@@ -13,7 +13,7 @@
debug("Test auto-repeat syntax.");
testGridTemplatesSetJSValues("repeat(auto-fill, [foo bar] 200px)", "repeat(auto-fill, 20em [foo bar])", "[foo bar] 200px [foo bar] 200px [foo bar] 200px [foo bar] 200px", "200px [foo bar] 200px [foo bar] 200px [foo bar]");
testGridTemplatesSetJSValues("repeat(auto-fill, [foo bar] minmax(300px, 1fr))", "repeat(auto-fill, [foo] minmax(175px, -webkit-max-content) [bar])", "[foo bar] 400px [foo bar] 400px", "[foo] 175px [bar foo] 175px [bar foo] 175px [bar]");
- testGridTemplatesSetJSValues("repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)", "repeat(1, 450px) repeat(auto-fill, minmax(5em, -webkit-max-content) [bar]) repeat(2, [foo] 1em)", "100px 100px 100px 250px 250px", "450px 50px [bar] 50px [bar foo] 10px [foo] 10px", "repeat(auto-fill, minmax(50px, 100px)) 250px 250px", "450px repeat(auto-fill, minmax(5em, -webkit-max-content) [bar]) [foo] 1em [foo] 1em");
+ testGridTemplatesSetJSValues("repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)", "repeat(1, 450px) repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) repeat(2, [foo] 1em)", "100px 100px 100px 250px 250px", "450px 50px [bar] 50px [bar foo] 10px [foo] 10px", "repeat(auto-fill, minmax(50px, 100px)) 250px 250px", "450px repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) [foo] 1em [foo] 1em");
testGridTemplatesSetJSValues("[start] 10% repeat(auto-fill, [foo bar] 200px) [end]", "75px [prev] repeat(auto-fill, 20em [foo bar]) [next] 15em [last end]", "[start] 80px [foo bar] 200px [foo bar] 200px [foo bar] 200px [end]", "75px [prev] 200px [foo bar next] 150px [last end]");
testGridTemplatesSetJSValues("repeat(auto-fit, [foo bar] 150px)", "repeat(auto-fit, 24em [foo bar])", "none", "none");
testGridTemplatesSetJSValues("repeat(auto-fit, [foo bar] minmax(270px, 1fr))", "repeat(auto-fit, [foo] minmax(20em, -webkit-max-content) [bar])", "none", "none");
@@ -30,14 +30,12 @@
}
testInvalidSyntax("repeat(auto-fill, 1fr)");
- testInvalidSyntax("repeat(auto-fill, minmax(-webkit-min-content, 20px))");
testInvalidSyntax("repeat(auto-fill, [bar] auto)");
testInvalidSyntax("repeat(auto-fill, 20px 10px)");
testInvalidSyntax("repeat(auto-fill, 20px [foo bar] 10px)");
testInvalidSyntax("repeat(auto-fill,)");
testInvalidSyntax("repeat(auto-fill, [foo])");
testInvalidSyntax("repeat(auto-fit, 1fr)");
- testInvalidSyntax("repeat(auto-fit, minmax(-webkit-min-content, 20px))");
testInvalidSyntax("repeat(auto-fit, [bar] auto)");
testInvalidSyntax("repeat(auto-fit, 20px 10px)");
testInvalidSyntax("repeat(auto-fit, 20px [foo bar] 10px)");
Modified: trunk/Source/WebCore/ChangeLog (201398 => 201399)
--- trunk/Source/WebCore/ChangeLog 2016-05-25 19:49:46 UTC (rev 201398)
+++ trunk/Source/WebCore/ChangeLog 2016-05-25 19:52:53 UTC (rev 201399)
@@ -1,3 +1,28 @@
+2016-05-25 Manuel Rego Casasnovas <[email protected]>
+
+ [css-grid] Update <fixed-size> syntax
+ https://bugs.webkit.org/show_bug.cgi?id=158063
+
+ Reviewed by Darin Adler.
+
+ The syntax for <fixed-size> has been updated on the spec:
+ https://drafts.csswg.org/css-grid/#typedef-fixed-size
+
+ New syntax is:
+ <fixed-size> =
+ <fixed-breadth> |
+ minmax( <fixed-breadth> , <track-breadth> ) |
+ minmax( <inflexible-breadth> , <fixed-breadth> )
+
+ This means that it's enough to have one <fixed-breadth>,
+ it doesn't matter if it's as minimum or maximum.
+ Before it was required that the minimum was fixed.
+
+ * css/CSSParser.cpp:
+ (WebCore::isGridTrackFixedSized):
+ * rendering/RenderGrid.cpp:
+ (WebCore::RenderGrid::computeAutoRepeatTracksCount):
+
2016-05-25 Alex Christensen <[email protected]>
Fix CMake build.
Modified: trunk/Source/WebCore/css/CSSParser.cpp (201398 => 201399)
--- trunk/Source/WebCore/css/CSSParser.cpp 2016-05-25 19:49:46 UTC (rev 201398)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2016-05-25 19:52:53 UTC (rev 201399)
@@ -5817,20 +5817,30 @@
return true;
}
-static bool isGridTrackFixedSized(const CSSValue& value)
+static bool isGridTrackFixedSized(const CSSPrimitiveValue& value)
{
- ASSERT(value.isPrimitiveValue() || (value.isFunctionValue() && downcast<CSSFunctionValue>(value).arguments()));
- const auto& primitiveValue = value.isPrimitiveValue()
- ? downcast<CSSPrimitiveValue>(value)
- : downcast<CSSPrimitiveValue>(*downcast<CSSFunctionValue>(value).arguments()->item(0));
- CSSValueID valueID = primitiveValue.getValueID();
- if (valueID == CSSValueWebkitMinContent || valueID == CSSValueWebkitMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex())
+ CSSValueID valueID = value.getValueID();
+ if (valueID == CSSValueWebkitMinContent || valueID == CSSValueWebkitMaxContent || valueID == CSSValueAuto || value.isFlex())
return false;
- ASSERT(primitiveValue.isLength() || primitiveValue.isPercentage() || primitiveValue.isCalculated());
+ ASSERT(value.isLength() || value.isPercentage() || value.isCalculated());
return true;
}
+static bool isGridTrackFixedSized(const CSSValue& value)
+{
+ if (value.isPrimitiveValue())
+ return isGridTrackFixedSized(downcast<CSSPrimitiveValue>(value));
+
+ ASSERT(value.isFunctionValue());
+ ASSERT(downcast<CSSFunctionValue>(value).arguments());
+ ASSERT(downcast<CSSFunctionValue>(value).arguments()->length() == 2);
+
+ auto& min = downcast<CSSPrimitiveValue>(*downcast<CSSFunctionValue>(value).arguments()->item(0));
+ auto& max = downcast<CSSPrimitiveValue>(*downcast<CSSFunctionValue>(value).arguments()->item(1));
+ return isGridTrackFixedSized(min) || isGridTrackFixedSized(max);
+}
+
RefPtr<CSSValue> CSSParser::parseGridTrackList()
{
ASSERT(isCSSGridLayoutEnabled());
Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (201398 => 201399)
--- trunk/Source/WebCore/rendering/RenderGrid.cpp 2016-05-25 19:49:46 UTC (rev 201398)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp 2016-05-25 19:52:53 UTC (rev 201399)
@@ -1227,7 +1227,7 @@
ASSERT(autoRepeatTracks.size() == 1);
auto autoTrackSize = autoRepeatTracks.at(0);
ASSERT(autoTrackSize.minTrackBreadth().isLength());
- ASSERT(!autoTrackSize.minTrackBreadth().isContentSized());
+ ASSERT(!autoTrackSize.minTrackBreadth().isFlex());
Optional<LayoutUnit> availableSize = isRowAxis ? availableLogicalWidth() : computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt);
if (!isRowAxis || containingBlock()) {
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
