Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d9d5b5e6ff86784a3bc8e05bea925d1fa7243774
https://github.com/WebKit/WebKit/commit/d9d5b5e6ff86784a3bc8e05bea925d1fa7243774
Author: Sammy Gill <[email protected]>
Date: 2026-07-30 (Thu, 30 Jul 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.h
M Source/WebCore/layout/formattingContexts/grid/GridLayout.cpp
M Source/WebCore/layout/formattingContexts/grid/GridLayout.h
M Source/WebCore/layout/formattingContexts/grid/UsedTrackSizes.h
M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp
M Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.h
Log Message:
-----------
[GFC][Integration] RenderGrid needs grid items' areas after layout.
https://bugs.webkit.org/show_bug.cgi?id=320583
rdar://problem/183559501
Reviewed by Alan Baradlay.
After laying out a grid, the integration layer tells the legacy grid that its
items
no longer need placement so that render tree clients which rely on that state
(e.g.
RenderGrid::paintChildren) behave as if placement had run. It does not, however,
populate the legacy grid's item area map, which only legacy placement fills in.
Clients which consult the grid area of a grid item outside of layout therefore
read
from an empty map. RenderGrid::isExtrinsicallySized, which
RenderObject::markContainingBlocksForLayout
calls on every ancestor grid, does exactly that through
isPlacedWithinExtrinsicallySizedExplicitTracks: its needsItemsPlacement() guard
passes
and Grid::gridItemArea asserts that the item is in the map.
We can have the integration layer write back the grid areas for each of
the grid items at the end of layout. This information is already
outputted to us by GridLayout as the part of the GridItemRects in
GridLayoutResult.
* Source/WebCore/layout/formattingContexts/grid/GridFormattingContext.cpp:
Return the GridLayoutResult that we got from GridLayout. It was being
used above to do some mapping of the grid item rects so that the
locations are in the coordinate space of the grid's content box.
* Source/WebCore/layout/integration/grid/LayoutIntegrationGridLayout.cpp:
Go through each item and take the line numbers for its grid area and map
them to "translated definite spans," which is what is seems like
RenderGrid uses for the positions of the grid item after placement is
done.
Canonical link: https://commits.webkit.org/318248@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications