Title: [290674] trunk
Revision
290674
Author
mattwood...@apple.com
Date
2022-03-01 13:57:06 -0800 (Tue, 01 Mar 2022)

Log Message

Use static position relative to parent for abs-pos items within nested grids.
https://bugs.webkit.org/show_bug.cgi?id=236957

Reviewed by Dean Jackson.

Source/WebCore:

In the case where an absolutely positioned element's parent and containing block
are both grid container, but they are not the same grid container, then the static position
of the abs-pos item should be relative to the parent, not the CB.

Existing subgrid tests marked as passing.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::setLogicalOffsetForChild const):

LayoutTests:

* TestExpectations:

       Existing subgrid tests marked as passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290673 => 290674)


--- trunk/LayoutTests/ChangeLog	2022-03-01 21:44:24 UTC (rev 290673)
+++ trunk/LayoutTests/ChangeLog	2022-03-01 21:57:06 UTC (rev 290674)
@@ -1,3 +1,14 @@
+2022-03-01  Matt Woodrow  <mattwood...@apple.com>
+
+        Use static position relative to parent for abs-pos items within nested grids.
+        https://bugs.webkit.org/show_bug.cgi?id=236957
+
+        Reviewed by Dean Jackson.
+
+        * TestExpectations:
+
+       Existing subgrid tests marked as passing.
+
 2022-03-01  Andres Gonzalez  <andresg...@apple.com>
 
         Make accessibility/aria-hidden-false-works-in-subtrees.html async to pass in isolated tree mode.

Modified: trunk/LayoutTests/TestExpectations (290673 => 290674)


--- trunk/LayoutTests/TestExpectations	2022-03-01 21:44:24 UTC (rev 290673)
+++ trunk/LayoutTests/TestExpectations	2022-03-01 21:57:06 UTC (rev 290674)
@@ -1399,7 +1399,6 @@
 webkit.org/b/236951 imported/w3c/web-platform-tests/css/css-grid/subgrid/auto-track-sizing-001.html [ ImageOnlyFailure ]
 webkit.org/b/236959 imported/w3c/web-platform-tests/css/css-grid/subgrid/baseline-001.html [ ImageOnlyFailure ]
 webkit.org/b/236956 imported/w3c/web-platform-tests/css/css-grid/subgrid/grid-gap-003.html [ ImageOnlyFailure ]
-webkit.org/b/236957 imported/w3c/web-platform-tests/css/css-grid/subgrid/line-names-007.html [ ImageOnlyFailure ]
 webkit.org/b/236958 imported/w3c/web-platform-tests/css/css-grid/subgrid/repeat-auto-fill-003.html [ ImageOnlyFailure ]
 webkit.org/b/236949 imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-mbp-overflow-001.html [ ImageOnlyFailure ]
 webkit.org/b/236949 imported/w3c/web-platform-tests/css/css-grid/subgrid/subgrid-mbp-overflow-002.html [ ImageOnlyFailure ]

Modified: trunk/Source/WebCore/ChangeLog (290673 => 290674)


--- trunk/Source/WebCore/ChangeLog	2022-03-01 21:44:24 UTC (rev 290673)
+++ trunk/Source/WebCore/ChangeLog	2022-03-01 21:57:06 UTC (rev 290674)
@@ -1,3 +1,19 @@
+2022-03-01  Matt Woodrow  <mattwood...@apple.com>
+
+        Use static position relative to parent for abs-pos items within nested grids.
+        https://bugs.webkit.org/show_bug.cgi?id=236957
+
+        Reviewed by Dean Jackson.
+
+        In the case where an absolutely positioned element's parent and containing block
+        are both grid container, but they are not the same grid container, then the static position
+        of the abs-pos item should be relative to the parent, not the CB.
+
+        Existing subgrid tests marked as passing.
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::setLogicalOffsetForChild const):
+
 2022-03-01  Alan Bujtas  <za...@apple.com>
 
         [IFC][Integration] Add InlineIterator::Box::visualRect

Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (290673 => 290674)


--- trunk/Source/WebCore/rendering/RenderGrid.cpp	2022-03-01 21:44:24 UTC (rev 290673)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp	2022-03-01 21:57:06 UTC (rev 290674)
@@ -1900,7 +1900,7 @@
 
 void RenderGrid::setLogicalOffsetForChild(RenderBox& child, GridTrackSizingDirection direction) const
 {
-    if (!child.isGridItem() && hasStaticPositionForChild(child, direction))
+    if (child.parent() != this && hasStaticPositionForChild(child, direction))
         return;
     // 'setLogicalLeft' and 'setLogicalTop' only take into account the child's writing-mode, that's why 'flowAwareDirectionForChild' is needed.
     if (GridLayoutFunctions::flowAwareDirectionForChild(*this, child, direction) == ForColumns)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to