Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a51f5969458168cc00d66cba2e745ce1dfcc2e42
https://github.com/WebKit/WebKit/commit/a51f5969458168cc00d66cba2e745ce1dfcc2e42
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] Replace LineState with flex line ranges and parallel per-line lists
https://bugs.webkit.org/show_bug.cgi?id=318519
Reviewed by Antti Koivisto.
LineState bundled a flex line's per-item working data (spans into allItems and
the
main size, margin, position, and cross size lists) with its two per-line scalars
(cross-axis offset and extent). FlexLayout::layout has no such struct: it drives
every phase from a LineRanges list plus the global per-item lists and per-line
LinesCrossSizeList / LinesCrossPositionList. Now that the earlier commits moved
all
of the per-item working data into global lists, LineState's per-item spans are
just
globalList.subspan(lineRange) -- redundant with flexLines.ranges -- so
LineState can
go.
Each phase (handleMainAxisAlignment,
distributeMainAxisFreeSpaceForMultilineColumnIfNeeded,
the cross-axis chain in repositionLogicalHeightDependentFlexItems, and the
flips) now
takes flexLines plus the global lists it needs and iterates
flexLines.ranges[lineIndex],
indexing the lists by the global flex item index (or slicing them for the
span-based
leaves placeFlexItems / layoutFlexItems). The two per-line scalars become
performFlexLayout-scope Vector<LayoutUnit> lists: lineCrossSizeList (the
promoted
flexLinesCrossSizeList) and lineCrossOffsetList, still mutated in place by the
cross-axis line alignment phase (handleCrossAxisAlignmentForFlexLines).
LineState and FlexLineStates are gone.
No change in behavior: every former field access resolves to the same value at
the
same point (the line's slice is the same backing store; the per-line scalar
lists
carry the single-line-height and align-content-stretch adjustments exactly as
the
fields did; performBaselineAlignment's sharing groups now hold global item
indices).
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::distributeMainAxisFreeSpaceForMultilineColumnIfNeeded):
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
(WebCore::RenderFlexibleBox::performFlexLayout):
(WebCore::RenderFlexibleBox::handleMainAxisAlignment):
(WebCore::RenderFlexibleBox::setFlexItemCountsForFirstAndLastLine):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexLines):
(WebCore::RenderFlexibleBox::computeCrossSizeForFlexItems):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexItems):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
(WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
(WebCore::RenderFlexibleBox::flipForWrapReverse):
(WebCore::RenderFlexibleBox::LineState::LineState): Deleted.
Canonical link: https://commits.webkit.org/316985@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications