Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: aee9be188fe42f946a278e308ec85c96fba34a65
https://github.com/WebKit/WebKit/commit/aee9be188fe42f946a278e308ec85c96fba34a65
Author: Alan Baradlay <[email protected]>
Date: 2026-07-11 (Sat, 11 Jul 2026)
Changed paths:
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[cleanup] Store each flex item's flow-aware location in a list instead of on
FlexLayoutItem
https://bugs.webkit.org/show_bug.cgi?id=318512
Reviewed by Antti Koivisto.
Each item's flow-aware location was accumulated on
FlexLayoutItem::flowAwareLocation
by the placement, alignment, and flip passes, then flushed to the renderer in a
final loop. FlexLayout::layout keeps position in a parallel list and leaves
LogicalFlexItem immutable. Match that: performFlexLayout owns a
Vector<LayoutPoint>
positionList and LineState carries a std::span<LayoutPoint> positions slice of
it,
symmetric with the flexLayoutItems and mainSizes spans it already holds.
placeFlexItems and layoutColumnReverse write positions[i] (and still apply it to
the renderer eagerly, so the multi-line column relayout in
distributeMainAxisFreeSpaceForMultilineColumnIfNeeded repaints from the placed
location); the cross-axis passes move the slot instead of the item, so
adjustAlignmentForFlexItem now takes a LayoutPoint& and
updateAutoMarginsInCrossAxis
threads one through; handleCrossAxisAlignmentForFlexLines/ForFlexItems, the
flips,
and baseline alignment address it by index. The final apply loop reads
positionList. FlexLayoutItem::flowAwareLocation is gone.
Behavior is unchanged: the same location is computed and written to the same
storage in the same order, only into the list rather than the item; the slice a
line writes is the same backing store the final loop reads, and positionList
lives
for the whole layout and is never resized after the slices are taken.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::LineState::LineState):
(WebCore::RenderFlexibleBox::distributeMainAxisFreeSpaceForMultilineColumnIfNeeded):
(WebCore::RenderFlexibleBox::setFlexItemGeometry):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::handleMainAxisAlignment):
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
(WebCore::RenderFlexibleBox::placeFlexItems):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexLines):
(WebCore::RenderFlexibleBox::adjustAlignmentForFlexItem):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexItems):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
(WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
(WebCore::RenderFlexibleBox::flipForWrapReverse):
Canonical link: https://commits.webkit.org/316968@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications