Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f7478a24f9c59b29f4befcf9cc147feff3bef3f3
https://github.com/WebKit/WebKit/commit/f7478a24f9c59b29f4befcf9cc147feff3bef3f3
Author: Sammy Gill <[email protected]>
Date: 2026-09-02 (Wed, 02 Sep 2026)
Changed paths:
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][Cleanup] Return a GridLanesResult from placement.
https://bugs.webkit.org/show_bug.cgi?id=322865
rdar://problem/186113237
Reviewed by Alan Baradlay.
GridLanesLayout kept the two outputs of a placement pass, m_itemOffsets and
m_gridContentSize, as member variables and exposed them through
offsetForGridItem() and
gridContentSize(). That forced RenderGrid to hold a reference to the whole
placement
object for the rest of layout just to read those two values, which is why
GridLanesLayoutRef was threaded through eight RenderGrid methods.
Introduce a GridLanesResult class which owns those two values and return it by
value from
performGridLanesPlacement(). This makes the output of a Grid Lanes type of
layout much more
defined. Callers do not need to figure out what they need in order to have a
proper layout
and that responsibility is pushed onto GridLanesLayout to define that output
properly.
* Source/WebCore/rendering/GridLanesLayout.cpp:
(WebCore::GridLanesLayout::placeGridLanesItems): Builds the result from each
item's
placement, absorbing the offset bookkeeping from updateItemOffset().
(WebCore::GridLanesLayout::insertIntoGridAndLayoutItem): Reports the item's
placement
rather than writing it into an out-param.
(WebCore::GridLanesLayout::updateRunningPositions): Ditto.
(WebCore::GridLanesResult::stackingAxisOffsetForGridItem): Moved from
GridLanesLayout::offsetForGridItem().
(WebCore::GridLanesLayout::updateItemOffset): Deleted, folded into
placeGridLanesItems().
* Source/WebCore/rendering/GridLanesLayout.h:
* Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize): Comment now names
the result
that callers actually read the placed size from.
* Source/WebCore/rendering/RenderGrid.cpp:
* Source/WebCore/rendering/RenderGrid.h:
Canonical link: https://commits.webkit.org/320346@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications