Title: [195529] trunk
Revision
195529
Author
[email protected]
Date
2016-01-25 01:24:19 -0800 (Mon, 25 Jan 2016)

Log Message

[css-grid] grid shorthand must reset gap properties to their initial values
https://bugs.webkit.org/show_bug.cgi?id=153354

Reviewed by Darin Adler.

Source/WebCore:

Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
their values, it must in any case reset them to the initial ones.

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

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 (195528 => 195529)


--- trunk/LayoutTests/ChangeLog	2016-01-25 08:18:11 UTC (rev 195528)
+++ trunk/LayoutTests/ChangeLog	2016-01-25 09:24:19 UTC (rev 195529)
@@ -1,3 +1,13 @@
+2016-01-22  Sergio Villar Senin  <[email protected]>
+
+        [css-grid] grid shorthand must reset gap properties to their initial values
+        https://bugs.webkit.org/show_bug.cgi?id=153354
+
+        Reviewed by Darin Adler.
+
+        * fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
+        * fast/css-grid-layout/grid-shorthand-get-set.html:
+
 2016-01-24  Brady Eidson  <[email protected]>
 
         Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.

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


--- trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt	2016-01-25 08:18:11 UTC (rev 195528)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set-expected.txt	2016-01-25 09:24:19 UTC (rev 195529)
@@ -258,6 +258,12 @@
 PASS element.style.webkitGridAutoColumns is "initial"
 PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-auto-rows') is "auto"
 PASS element.style.webkitGridAutoRows is "initial"
+
+Test the inherit value on reset-only subproperties (grid-*-gap)
+PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap') is "0px"
+PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap') is "0px"
+PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap') is "20px"
+PASS getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap') is "100px"
 PASS successfullyParsed is true
 
 TEST COMPLETE

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


--- trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html	2016-01-25 08:18:11 UTC (rev 195528)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html	2016-01-25 09:24:19 UTC (rev 195529)
@@ -1,4 +1,4 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html>
 <html>
 <head>
 <link href="" rel="stylesheet">
@@ -178,6 +178,17 @@
     testGridDefinitionsSetJSValues("column 10px / 20px", "none", "none", "none", "column", "10px", "20px", "initial", "initial", "initial", "column", "10px", "20px");
     testGridDefinitionsSetJSValues("none", "none", "none", "none", "row", "auto", "auto", "none", "none", "none", "initial", "initial", "initial");
 
+    debug("");
+    debug("Test the inherit value on reset-only subproperties (grid-*-gap)");
+    document.body.style.webkitGridRowGap = "100px";
+    document.body.style.webkitGridColumnGap = "20px";
+    var anotherElement = document.createElement("div");
+    document.body.appendChild(anotherElement);
+    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap')", "0px");
+    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap')", "0px");
+    anotherElement.style.webkitGrid = "inherit";
+    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-column-gap')", "20px");
+    shouldBeEqualToString("getComputedStyle(anotherElement, '').getPropertyValue('-webkit-grid-row-gap')", "100px");
 </script>
 </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (195528 => 195529)


--- trunk/Source/WebCore/ChangeLog	2016-01-25 08:18:11 UTC (rev 195528)
+++ trunk/Source/WebCore/ChangeLog	2016-01-25 09:24:19 UTC (rev 195529)
@@ -1,3 +1,18 @@
+2016-01-22  Sergio Villar Senin  <[email protected]>
+
+        [css-grid] grid shorthand must reset gap properties to their initial values
+        https://bugs.webkit.org/show_bug.cgi?id=153354
+
+        Reviewed by Darin Adler.
+
+        Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
+        'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
+        their values, it must in any case reset them to the initial ones.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseGridShorthand):
+        * css/CSSPropertyNames.in:
+
 2016-01-24  Brady Eidson  <[email protected]>
 
         Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.

Modified: trunk/Source/WebCore/css/CSSParser.cpp (195528 => 195529)


--- trunk/Source/WebCore/css/CSSParser.cpp	2016-01-25 08:18:11 UTC (rev 195528)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2016-01-25 09:24:19 UTC (rev 195529)
@@ -5650,7 +5650,7 @@
 bool CSSParser::parseGridShorthand(bool important)
 {
     ShorthandScope scope(this, CSSPropertyWebkitGrid);
-    ASSERT(shorthandForProperty(CSSPropertyWebkitGrid).length() == 6);
+    ASSERT(shorthandForProperty(CSSPropertyWebkitGrid).length() == 8);
 
     // 1- <grid-template>
     if (parseGridTemplateShorthand(important)) {
@@ -5659,6 +5659,8 @@
         addProperty(CSSPropertyWebkitGridAutoFlow, CSSValuePool::singleton().createImplicitInitialValue(), important);
         addProperty(CSSPropertyWebkitGridAutoColumns, CSSValuePool::singleton().createImplicitInitialValue(), important);
         addProperty(CSSPropertyWebkitGridAutoRows, CSSValuePool::singleton().createImplicitInitialValue(), important);
+        addProperty(CSSPropertyWebkitGridColumnGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
+        addProperty(CSSPropertyWebkitGridRowGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
         return true;
     }
 
@@ -5703,6 +5705,8 @@
     addProperty(CSSPropertyWebkitGridTemplateColumns, CSSValuePool::singleton().createImplicitInitialValue(), important);
     addProperty(CSSPropertyWebkitGridTemplateRows, CSSValuePool::singleton().createImplicitInitialValue(), important);
     addProperty(CSSPropertyWebkitGridTemplateAreas, CSSValuePool::singleton().createImplicitInitialValue(), important);
+    addProperty(CSSPropertyWebkitGridColumnGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
+    addProperty(CSSPropertyWebkitGridRowGap, CSSValuePool::singleton().createImplicitInitialValue(), important);
 
     return true;
 }

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (195528 => 195529)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2016-01-25 08:18:11 UTC (rev 195528)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2016-01-25 09:24:19 UTC (rev 195529)
@@ -491,7 +491,7 @@
 justify-items [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
 -webkit-justify-items = justify-items
 #if defined(ENABLE_CSS_GRID_LAYOUT) && ENABLE_CSS_GRID_LAYOUT
--webkit-grid [Longhands=-webkit-grid-template-columns|-webkit-grid-template-rows|-webkit-grid-template-areas|-webkit-grid-auto-flow|-webkit-grid-auto-columns|-webkit-grid-auto-rows]
+-webkit-grid [Longhands=-webkit-grid-template-columns|-webkit-grid-template-rows|-webkit-grid-template-areas|-webkit-grid-auto-flow|-webkit-grid-auto-columns|-webkit-grid-auto-rows|-webkit-grid-column-gap|-webkit-grid-row-gap]
 -webkit-grid-area [Longhands=-webkit-grid-row-start|-webkit-grid-column-start|-webkit-grid-row-end|-webkit-grid-column-end]
 -webkit-grid-auto-columns [Converter=GridTrackSize]
 -webkit-grid-auto-rows [Converter=GridTrackSize]
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to