Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: efff72a3b9ffcf15c4af0b28648a7c209a5d8eb6
https://github.com/WebKit/WebKit/commit/efff72a3b9ffcf15c4af0b28648a7c209a5d8eb6
Author: Sammy Gill <[email protected]>
Date: 2026-08-25 (Tue, 25 Aug 2026)
Changed paths:
M Source/WebCore/inspector/InspectorOverlay.cpp
M Source/WebCore/rendering/GridLanesLayout.cpp
M Source/WebCore/rendering/GridLanesLayout.h
M Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
M Source/WebCore/rendering/RenderGrid.cpp
M Source/WebCore/rendering/RenderGrid.h
Log Message:
-----------
[Grid Lanes] GridLanesLayout does not need to live on RenderGrid.
https://bugs.webkit.org/show_bug.cgi?id=322316
rdar://problem/185555283
Reviewed by Alan Baradlay.
RenderGrid held onto a GridLanesLayout object as a member and generally
we want to avoid having items live on the renderer unless they are
needed for some reason after layout. There are a couple of grid lanes
related information that is needed for the web inspector but there is no
need to hold onto the whole object so in the patch we change it to be a
local stack variable that is alive during the duration of layout.
This is mostly a mechanical change where we create the GridLanesLayout
object on the stack and then thread it through different areas of the
code where it is needed. There are some bits of RenderGrid code that
seem to need access to this object so we thread it through as an
optional std::ref to appease both the Grid and Grid Lanes situations.
* Source/WebCore/inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::buildGridOverlay):
This is the only piece of information that is needed outside of layout.
The web inspector overlay needs to know the grid content size so we will
keep that one piece of information on the renderer and label it so it is
clear what it is being used for.
* Source/WebCore/rendering/GridLanesLayout.cpp:
(WebCore::GridLanesLayout::performGridLanesPlacement):
populateGridPositionsForDirection needs access to a GridLanesLayout
object in this case so we wrap it in a optional std::ref so that it can
use it.
* Source/WebCore/rendering/GridLanesLayout.h:
Need to initialize some of these members as well!
(WebCore::GridLanesLayout::gridGap const): Deleted.
Unused.
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize const):
This one is a little interesting because all callers of this function
could not actually trigger the if (isDirectionInStackingAxis()) logic.
So I remove that code and replace it with a debug assert instead.
Canonical link: https://commits.webkit.org/319810@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications