Title: [196906] trunk
Revision
196906
Author
r...@igalia.com
Date
2016-02-22 01:01:45 -0800 (Mon, 22 Feb 2016)

Log Message

[css-grid] Swap columns and rows in grid shorthand
https://bugs.webkit.org/show_bug.cgi?id=154449

Reviewed by Darin Adler.

The spec was modified past December to change the order of
columns and rows in the grid shorthand:
https://github.com/w3c/csswg-drafts/commit/7454c7c8c5857b61bbbe2ee5f07803c264bf37e4

Updated the parsing and modified the tests to follow the new syntax.

Source/WebCore:

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridShorthand):

LayoutTests:

* fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-shorthand-get-set.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196905 => 196906)


--- trunk/LayoutTests/ChangeLog	2016-02-22 09:00:12 UTC (rev 196905)
+++ trunk/LayoutTests/ChangeLog	2016-02-22 09:01:45 UTC (rev 196906)
@@ -1,3 +1,19 @@
+2016-02-22  Manuel Rego Casasnovas  <r...@igalia.com>
+
+        [css-grid] Swap columns and rows in grid shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=154449
+
+        Reviewed by Darin Adler.
+
+        The spec was modified past December to change the order of
+        columns and rows in the grid shorthand:
+        https://github.com/w3c/csswg-drafts/commit/7454c7c8c5857b61bbbe2ee5f07803c264bf37e4
+
+        Updated the parsing and modified the tests to follow the new syntax.
+
+        * fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
+        * fast/css-grid-layout/grid-shorthand-get-set.html:
+
 2016-02-21  Chris Dumez  <cdu...@apple.com>
 
         Make HTMLSelectElement.size behave as per the specification

Modified: trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt (196905 => 196906)


--- trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt	2016-02-22 09:00:12 UTC (rev 196905)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt	2016-02-22 09:01:45 UTC (rev 196906)
@@ -28,18 +28,18 @@
 PASS window.getComputedStyle(gridWithTemplateNone, '').getPropertyValue('-webkit-grid-auto-flow') is "row"
 PASS window.getComputedStyle(gridWithTemplateNone, '').getPropertyValue('-webkit-grid-auto-columns') is "auto"
 PASS window.getComputedStyle(gridWithTemplateNone, '').getPropertyValue('-webkit-grid-auto-rows') is "auto"
-PASS window.getComputedStyle(gridWithAutoFlowDenseAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-columns') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowDenseAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-rows') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowDenseAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-areas') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowDenseAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-flow') is "row dense"
-PASS window.getComputedStyle(gridWithAutoFlowDenseAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
-PASS window.getComputedStyle(gridWithAutoFlowDenseAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-rows') is "20px"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumns, '').getPropertyValue('-webkit-grid-auto-flow') is "column"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumns, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumns, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
+PASS window.getComputedStyle(gridWithAutoFlowDenseAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowDenseAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowDenseAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowDenseAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-flow') is "row dense"
+PASS window.getComputedStyle(gridWithAutoFlowDenseAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-columns') is "20px"
+PASS window.getComputedStyle(gridWithAutoFlowDenseAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
+PASS window.getComputedStyle(gridWithAutoFlowAndRows, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowAndRows, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowAndRows, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowAndRows, '').getPropertyValue('-webkit-grid-auto-flow') is "column"
+PASS window.getComputedStyle(gridWithAutoFlowAndRows, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
+PASS window.getComputedStyle(gridWithAutoFlowAndRows, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
 PASS window.getComputedStyle(gridWithAutoFlowDense, '').getPropertyValue('-webkit-grid-template-columns') is "none"
 PASS window.getComputedStyle(gridWithAutoFlowDense, '').getPropertyValue('-webkit-grid-template-rows') is "none"
 PASS window.getComputedStyle(gridWithAutoFlowDense, '').getPropertyValue('-webkit-grid-template-areas') is "none"
@@ -58,12 +58,12 @@
 PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('-webkit-grid-auto-flow') is "row dense"
 PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
 PASS window.getComputedStyle(gridWithAutoFlowDenseRow, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-columns') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-rows') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-areas') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-flow') is "column"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
-PASS window.getComputedStyle(gridWithAutoFlowAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-rows') is "20px"
+PASS window.getComputedStyle(gridWithAutoFlowAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-flow') is "column"
+PASS window.getComputedStyle(gridWithAutoFlowAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-columns') is "20px"
+PASS window.getComputedStyle(gridWithAutoFlowAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
 
 Test setting wrong values for 'grid' shorthand through CSS (they should resolve to the default: 'row')
 PASS window.getComputedStyle(gridWithNone, '').getPropertyValue('-webkit-grid-template-columns') is "none"
@@ -72,12 +72,12 @@
 PASS window.getComputedStyle(gridWithNone, '').getPropertyValue('-webkit-grid-auto-flow') is "row"
 PASS window.getComputedStyle(gridWithNone, '').getPropertyValue('-webkit-grid-auto-columns') is "auto"
 PASS window.getComputedStyle(gridWithNone, '').getPropertyValue('-webkit-grid-auto-rows') is "auto"
-PASS window.getComputedStyle(gridWithAutoFlowNoneAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-columns') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowNoneAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-rows') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowNoneAndColumnsAndRows, '').getPropertyValue('-webkit-grid-template-areas') is "none"
-PASS window.getComputedStyle(gridWithAutoFlowNoneAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-flow') is "row"
-PASS window.getComputedStyle(gridWithAutoFlowNoneAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-columns') is "auto"
-PASS window.getComputedStyle(gridWithAutoFlowNoneAndColumnsAndRows, '').getPropertyValue('-webkit-grid-auto-rows') is "auto"
+PASS window.getComputedStyle(gridWithAutoFlowNoneAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowNoneAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowNoneAndRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridWithAutoFlowNoneAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-flow') is "row"
+PASS window.getComputedStyle(gridWithAutoFlowNoneAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-columns') is "auto"
+PASS window.getComputedStyle(gridWithAutoFlowNoneAndRowsAndColumns, '').getPropertyValue('-webkit-grid-auto-rows') is "auto"
 PASS window.getComputedStyle(gridWithAutoFlowNone, '').getPropertyValue('-webkit-grid-template-columns') is "none"
 PASS window.getComputedStyle(gridWithAutoFlowNone, '').getPropertyValue('-webkit-grid-template-rows') is "none"
 PASS window.getComputedStyle(gridWithAutoFlowNone, '').getPropertyValue('-webkit-grid-template-areas') is "none"
@@ -214,10 +214,10 @@
 PASS element.style.webkitGridTemplateAreas is "initial"
 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-flow') is "column"
 PASS element.style.webkitGridAutoFlow is "column"
-PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-columns') is "20px"
-PASS element.style.webkitGridAutoColumns is "20px"
-PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
-PASS element.style.webkitGridAutoRows is "10px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
+PASS element.style.webkitGridAutoColumns is "10px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-rows') is "20px"
+PASS element.style.webkitGridAutoRows is "20px"
 
 Test the initial value
 PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
@@ -242,10 +242,10 @@
 PASS element.style.webkitGridTemplateAreas is "initial"
 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-flow') is "column"
 PASS element.style.webkitGridAutoFlow is "column"
-PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-columns') is "10px"
-PASS element.style.webkitGridAutoColumns is "10px"
-PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-rows') is "20px"
-PASS element.style.webkitGridAutoRows is "20px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-columns') is "20px"
+PASS element.style.webkitGridAutoColumns is "20px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-rows') is "10px"
+PASS element.style.webkitGridAutoRows is "10px"
 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
 PASS element.style.webkitGridTemplateColumns is "none"
 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"

Modified: trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html (196905 => 196906)


--- trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html	2016-02-22 09:00:12 UTC (rev 196905)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html	2016-02-22 09:01:45 UTC (rev 196906)
@@ -15,10 +15,10 @@
 #gridWithTemplateNone {
     -webkit-grid: none / 10px;
 }
-#gridWithAutoFlowDenseAndColumnsAndRows {
+#gridWithAutoFlowDenseAndRowsAndColumns {
     -webkit-grid: dense 10px / 20px;
 }
-#gridWithAutoFlowAndColumns {
+#gridWithAutoFlowAndRows {
     -webkit-grid: column 10px;
 }
 #gridWithAutoFlowDense {
@@ -30,7 +30,7 @@
 #gridWithAutoFlowDenseRow {
     -webkit-grid: dense row 10px;
 }
-#gridWithAutoFlowAndColumnsAndRows {
+#gridWithAutoFlowAndRowsAndColumns {
     -webkit-grid: column 10px / 20px;
 }
 
@@ -39,7 +39,7 @@
 #gridWithNone {
     -webkit-grid: none;
 }
-#gridWithAutoFlowNoneAndColumnsAndRows {
+#gridWithAutoFlowNoneAndRowsAndColumns {
     -webkit-grid: none 10px / 20px;
 }
 #gridWithAutoFlowNone {
@@ -94,15 +94,15 @@
 <div class="grid" id="gridWithDense"></div>
 <div class="grid" id="gridWithTemplate"></div>
 <div class="grid" id="gridWithTemplate1"></div>
-<div class="grid" id="gridWithAutoFlowDenseAndColumnsAndRows"></div>
-<div class="grid" id="gridWithAutoFlowAndColumns"></div>
+<div class="grid" id="gridWithAutoFlowDenseAndRowsAndColumns"></div>
+<div class="grid" id="gridWithAutoFlowAndRows"></div>
 <div class="grid" id="gridWithAutoFlowDense"></div>
 <div class="grid" id="gridWithAutoFlowColumnDense"></div>
 <div class="grid" id="gridWithAutoFlowDenseRow"></div>
-<div class="grid" id="gridWithAutoFlowAndColumnsAndRows"></div>
+<div class="grid" id="gridWithAutoFlowAndRowsAndColumns"></div>
 <div class="grid" id="gridWithNone"></div>
 <div class="grid" id="gridWithTemplateNone"></div>
-<div class="grid" id="gridWithAutoFlowNoneAndColumnsAndRows"></div>
+<div class="grid" id="gridWithAutoFlowNoneAndRowsAndColumns"></div>
 <div class="grid" id="gridWithAutoFlowNone"></div>
 <div class="grid" id="gridWithExplicitAndImplicit"></div>
 <div class="grid" id="gridWithMisplacedNone1"></div>
@@ -127,17 +127,17 @@
     testGridDefinitionsValues(document.getElementById("gridWithTemplate"), "15px", "10px", "none", "row", "auto", "auto");
     testGridDefinitionsValues(document.getElementById("gridWithTemplate1"), "none", "10px", "none", "row", "auto", "auto");
     testGridDefinitionsValues(document.getElementById("gridWithTemplateNone"), "none", "10px", "none", "row", "auto", "auto");
-    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowDenseAndColumnsAndRows"), "none", "none", "none", "row dense", "10px", "20px");
-    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndColumns"), "none", "none", "none", "column", "10px", "10px");
+    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowDenseAndRowsAndColumns"), "none", "none", "none", "row dense", "20px", "10px");
+    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndRows"), "none", "none", "none", "column", "10px", "10px");
     testGridDefinitionsValues(document.getElementById("gridWithAutoFlowDense"), "none", "none", "none", "row dense", "10px", "10px");
     testGridDefinitionsValues(document.getElementById("gridWithAutoFlowColumnDense"), "none", "none", "none", "column dense", "10px", "10px");
     testGridDefinitionsValues(document.getElementById("gridWithAutoFlowDenseRow"), "none", "none", "none", "row dense", "10px", "10px");
-    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndColumnsAndRows"), "none", "none", "none", "column", "10px", "20px");
+    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowAndRowsAndColumns"), "none", "none", "none", "column", "20px", "10px");
 
     debug("");
     debug("Test setting wrong values for 'grid' shorthand through CSS (they should resolve to the default: 'row')");
     testGridDefinitionsValues(document.getElementById("gridWithNone"), "none", "none", "none", "row", "auto", "auto");
-    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowNoneAndColumnsAndRows"), "none", "none", "none", "row", "auto", "auto");
+    testGridDefinitionsValues(document.getElementById("gridWithAutoFlowNoneAndRowsAndColumns"), "none", "none", "none", "row", "auto", "auto");
     testGridDefinitionsValues(document.getElementById("gridWithAutoFlowNone"), "none", "none", "none", "row", "auto", "auto");
     testGridDefinitionsValues(document.getElementById("gridWithExplicitAndImplicit"), "none", "none", "none", "row", "auto", "auto");
     testGridDefinitionsValues(document.getElementById("gridWithMisplacedNone1"), "none", "none", "none", "row", "auto", "auto");
@@ -159,7 +159,7 @@
     testGridDefinitionsSetJSValues("10px / 20px", "10px", "20px", "none", "row", "auto", "auto", "10px", "20px", "none", "initial", "initial", "initial");
     testGridDefinitionsSetJSValues("10px / [line] 'a' 20px", "10px", "[line] 20px", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "initial", "initial");
     testGridDefinitionsSetJSValues("row dense 20px", "none", "none", "none", "row dense", "20px", "20px", "initial", "initial", "initial", "row dense", "20px", "20px");
-    testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none", "column", "20px", "10px", "initial", "initial", "initial", "column", "20px", "10px");
+    testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none", "column", "10px", "20px", "initial", "initial", "initial", "column", "10px", "20px");
 
     debug("");
     debug("Test the initial value");
@@ -175,7 +175,7 @@
 
     debug("");
     debug("Test setting grid-template-columns and grid-template-rows back to 'none' through JS");
-    testGridDefinitionsSetJSValues("column 10px / 20px", "none", "none", "none", "column", "10px", "20px", "initial", "initial", "initial", "column", "10px", "20px");
+    testGridDefinitionsSetJSValues("column 10px / 20px", "none", "none", "none", "column", "20px", "10px", "initial", "initial", "initial", "column", "20px", "10px");
     testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "initial", "initial", "initial");
 
     debug("");

Modified: trunk/Source/WebCore/ChangeLog (196905 => 196906)


--- trunk/Source/WebCore/ChangeLog	2016-02-22 09:00:12 UTC (rev 196905)
+++ trunk/Source/WebCore/ChangeLog	2016-02-22 09:01:45 UTC (rev 196906)
@@ -1,3 +1,19 @@
+2016-02-22  Manuel Rego Casasnovas  <r...@igalia.com>
+
+        [css-grid] Swap columns and rows in grid shorthand
+        https://bugs.webkit.org/show_bug.cgi?id=154449
+
+        Reviewed by Darin Adler.
+
+        The spec was modified past December to change the order of
+        columns and rows in the grid shorthand:
+        https://github.com/w3c/csswg-drafts/commit/7454c7c8c5857b61bbbe2ee5f07803c264bf37e4
+
+        Updated the parsing and modified the tests to follow the new syntax.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseGridShorthand):
+
 2016-02-22  Youenn Fablet  <youenn.fab...@crf.canon.fr>
 
         Binding generator should support key value iterable

Modified: trunk/Source/WebCore/css/CSSParser.cpp (196905 => 196906)


--- trunk/Source/WebCore/css/CSSParser.cpp	2016-02-22 09:00:12 UTC (rev 196905)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2016-02-22 09:01:45 UTC (rev 196906)
@@ -5696,14 +5696,14 @@
     RefPtr<CSSValue> autoRowsValue;
 
     if (m_valueList->current()) {
-        autoColumnsValue = parseGridTrackSize(*m_valueList);
-        if (!autoColumnsValue)
+        autoRowsValue = parseGridTrackSize(*m_valueList);
+        if (!autoRowsValue)
             return false;
         if (m_valueList->current()) {
             if (!isForwardSlashOperator(*m_valueList->current()) || !m_valueList->next())
                 return false;
-            autoRowsValue = parseGridTrackSize(*m_valueList);
-            if (!autoRowsValue)
+            autoColumnsValue = parseGridTrackSize(*m_valueList);
+            if (!autoColumnsValue)
                 return false;
         }
         if (m_valueList->current())
@@ -5715,8 +5715,8 @@
     }
 
     // if <grid-auto-rows> value is omitted, it is set to the value specified for grid-auto-columns.
-    if (!autoRowsValue)
-        autoRowsValue = autoColumnsValue;
+    if (!autoColumnsValue)
+        autoColumnsValue = autoRowsValue;
 
     addProperty(CSSPropertyWebkitGridAutoColumns, autoColumnsValue.release(), important);
     addProperty(CSSPropertyWebkitGridAutoRows, autoRowsValue.release(), important);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to