Title: [236126] trunk
Revision
236126
Author
[email protected]
Date
2018-09-18 08:13:40 -0700 (Tue, 18 Sep 2018)

Log Message

[css-grid] Static position should use content-box, not padding-box
https://bugs.webkit.org/show_bug.cgi?id=189698

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html:
Update tests from WPT.

Source/WebCore:

This is a recent change by the CSSWG:
https://github.com/w3c/csswg-drafts/issues/3020

The spec text (https://drafts.csswg.org/css-grid/#static-position):
  "The static position of an absolutely-positioned child
   of a grid container is determined as if it were the sole grid item
   in a grid area whose edges coincide with the content edges
   of the grid container."

Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::prepareChildForPositionedLayout):
Simple change to use border and padding.

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (236125 => 236126)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2018-09-18 14:50:41 UTC (rev 236125)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2018-09-18 15:13:40 UTC (rev 236126)
@@ -1,3 +1,13 @@
+2018-09-18  Manuel Rego Casasnovas  <[email protected]>
+
+        [css-grid] Static position should use content-box, not padding-box
+        https://bugs.webkit.org/show_bug.cgi?id=189698
+
+        Reviewed by Javier Fernandez.
+
+        * web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html:
+        Update tests from WPT.
+
 2018-09-12  Ryosuke Niwa  <[email protected]>
 
         Update composedPath to match the latest spec

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html (236125 => 236126)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html	2018-09-18 14:50:41 UTC (rev 236125)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html	2018-09-18 15:13:40 UTC (rev 236126)
@@ -41,19 +41,19 @@
 
 <div class="container relative">
   <div class="grid">
-    <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
+    <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
   </div>
 </div>
 
 <div class="container relative">
   <div class="grid">
-    <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
+    <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
   </div>
 </div>
 
 <div class="container relative">
   <div class="grid">
-    <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="35" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
+    <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="50" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
   </div>
 </div>
 
@@ -77,19 +77,19 @@
 
 <div class="container relative">
   <div class="grid directionRTL">
-    <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
+    <div class="sizedToGridArea absolute autoRowAutoColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
   </div>
 </div>
 
 <div class="container relative">
   <div class="grid directionRTL">
-    <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
+    <div class="sizedToGridArea absolute firstRowFirstColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
   </div>
 </div>
 
 <div class="container relative">
   <div class="grid directionRTL">
-    <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="-135" data-offset-y="5" data-expected-width="500" data-expected-height="400"></div>
+    <div class="sizedToGridArea absolute secondRowSecondColumn" data-offset-x="-150" data-offset-y="10" data-expected-width="500" data-expected-height="400"></div>
   </div>
 </div>
 

Modified: trunk/Source/WebCore/ChangeLog (236125 => 236126)


--- trunk/Source/WebCore/ChangeLog	2018-09-18 14:50:41 UTC (rev 236125)
+++ trunk/Source/WebCore/ChangeLog	2018-09-18 15:13:40 UTC (rev 236126)
@@ -1,3 +1,25 @@
+2018-09-18  Manuel Rego Casasnovas  <[email protected]>
+
+        [css-grid] Static position should use content-box, not padding-box
+        https://bugs.webkit.org/show_bug.cgi?id=189698
+
+        Reviewed by Javier Fernandez.
+
+        This is a recent change by the CSSWG:
+        https://github.com/w3c/csswg-drafts/issues/3020
+
+        The spec text (https://drafts.csswg.org/css-grid/#static-position):
+          "The static position of an absolutely-positioned child
+           of a grid container is determined as if it were the sole grid item
+           in a grid area whose edges coincide with the content edges
+           of the grid container."
+
+        Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::prepareChildForPositionedLayout):
+        Simple change to use border and padding.
+
 2018-09-18  Xabier Rodriguez Calvar  <[email protected]>
 
         [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (236125 => 236126)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2018-09-18 14:50:41 UTC (rev 236125)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2018-09-18 15:13:40 UTC (rev 236126)
@@ -903,8 +903,9 @@
     child.containingBlock()->insertPositionedObject(child);
 
     RenderLayer* childLayer = child.layer();
-    childLayer->setStaticInlinePosition(borderStart());
-    childLayer->setStaticBlockPosition(borderBefore());
+    // Static position of a positioned child should use the content-box (https://drafts.csswg.org/css-grid/#static-position).
+    childLayer->setStaticInlinePosition(borderAndPaddingStart());
+    childLayer->setStaticBlockPosition(borderAndPaddingBefore());
 }
 
 bool RenderGrid::hasStaticPositionForChild(const RenderBox& child, GridTrackSizingDirection direction) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to