Title: [291953] trunk
Revision
291953
Author
[email protected]
Date
2022-03-27 13:38:38 -0700 (Sun, 27 Mar 2022)

Log Message

Use the sizing algorithm's available size to compute grid gap.
https://bugs.webkit.org/show_bug.cgi?id=236956

Reviewed by Tim Nguyen.

Source/WebCore:

Computing the grid gap for subgridded tracks happens during the sizing algorithm
(as part of copying the sizes from the parent, instead of computing new sizes). At
this point we should always have a definite size available (the size of the tracks in
the parent that the subgrid spans), but it may not yet be set on the subgrid's RenderElement.
This retreives the size from the track sizing algorithm instead, where it should always be
available by this point.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::copyUsedTrackSizesForSubgrid):

LayoutTests:

* TestExpectations:

Existing subgrid tests marked as passing.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (291952 => 291953)


--- trunk/LayoutTests/ChangeLog	2022-03-27 20:24:03 UTC (rev 291952)
+++ trunk/LayoutTests/ChangeLog	2022-03-27 20:38:38 UTC (rev 291953)
@@ -1,5 +1,16 @@
 2022-03-27  Matt Woodrow  <[email protected]>
 
+        Use the sizing algorithm's available size to compute grid gap.
+        https://bugs.webkit.org/show_bug.cgi?id=236956
+
+        Reviewed by Tim Nguyen.
+
+        * TestExpectations:
+
+        Existing subgrid tests marked as passing.
+
+2022-03-27  Matt Woodrow  <[email protected]>
+
         Lazily allocate backing store for grid columns.
         https://bugs.webkit.org/show_bug.cgi?id=212201
 

Modified: trunk/LayoutTests/TestExpectations (291952 => 291953)


--- trunk/LayoutTests/TestExpectations	2022-03-27 20:24:03 UTC (rev 291952)
+++ trunk/LayoutTests/TestExpectations	2022-03-27 20:38:38 UTC (rev 291953)
@@ -1416,7 +1416,6 @@
 imported/w3c/web-platform-tests/css/css-grid/masonry/tentative/masonry-subgrid-002.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/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 (291952 => 291953)


--- trunk/Source/WebCore/ChangeLog	2022-03-27 20:24:03 UTC (rev 291952)
+++ trunk/Source/WebCore/ChangeLog	2022-03-27 20:38:38 UTC (rev 291953)
@@ -1,5 +1,22 @@
 2022-03-27  Matt Woodrow  <[email protected]>
 
+        Use the sizing algorithm's available size to compute grid gap.
+        https://bugs.webkit.org/show_bug.cgi?id=236956
+
+        Reviewed by Tim Nguyen.
+
+        Computing the grid gap for subgridded tracks happens during the sizing algorithm
+        (as part of copying the sizes from the parent, instead of computing new sizes). At
+        this point we should always have a definite size available (the size of the tracks in
+        the parent that the subgrid spans), but it may not yet be set on the subgrid's RenderElement.
+        This retreives the size from the track sizing algorithm instead, where it should always be
+        available by this point.
+
+        * rendering/GridTrackSizingAlgorithm.cpp:
+        (WebCore::GridTrackSizingAlgorithm::copyUsedTrackSizesForSubgrid):
+
+2022-03-27  Matt Woodrow  <[email protected]>
+
         Lazily allocate backing store for grid columns.
         https://bugs.webkit.org/show_bug.cgi?id=212201
 

Modified: trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (291952 => 291953)


--- trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp	2022-03-27 20:24:03 UTC (rev 291952)
+++ trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp	2022-03-27 20:38:38 UTC (rev 291953)
@@ -1543,7 +1543,7 @@
     LayoutUnit endMBP = (m_direction == ForColumns) ? m_renderGrid->marginAndBorderAndPaddingEnd() : m_renderGrid->marginAndBorderAndPaddingAfter();
     removeSubgridMarginBorderPaddingFromTracks(allTracks, endMBP, false);
 
-    LayoutUnit gapDifference = (m_renderGrid->gridGap(m_direction) - outer->gridGap(direction)) / 2;
+    LayoutUnit gapDifference = (m_renderGrid->gridGap(m_direction, availableSpace(m_direction)) - outer->gridGap(direction)) / 2;
     for (int i = 0; i < numTracks; i++) {
         LayoutUnit size = allTracks[i].baseSize();
         if (i)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to