Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1d2267e7180f30f7c05580e5914de46e4fe33dcb
https://github.com/WebKit/WebKit/commit/1d2267e7180f30f7c05580e5914de46e4fe33dcb
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] Pass the used cross size into availableAlignmentSpaceForFlexItem
and marginBoxAscentForFlexItem instead of reading the renderer
https://bugs.webkit.org/show_bug.cgi?id=318518
Reviewed by Antti Koivisto.
Following 318517, which captured each flex item's used cross size into
computeCrossSizeForFlexItems's list, route the remaining post-stretch cross-axis
alignment reads through that list. availableAlignmentSpaceForFlexItem and
marginBoxAscentForFlexItem now take the used cross size as an argument rather
than
reading crossAxisExtentForFlexItem (the renderer's border box) themselves.
Their post-stretch callers (handleCrossAxisAlignmentForFlexItems and
performBaselineAlignment) pass crossSizes[itemIndex] -- the value captured in
#11,
which nothing relays out before these phases, so it is exactly what they read
from
the renderer before. The two callers that run outside that window pass
crossAxisExtentForFlexItem directly, unchanged: crossSizeForFlexLines (#8,
before
the stretch pass, and only for baseline items, which are never stretched) and
the
out-of-flow static-position path, whose item is not in the list. So the used
cross size now flows through the algorithm's list for the whole post-stretch
alignment path; the only renderer cross-size reads left are #8 and the external
baseline queries (firstLineBaseline / baselinePosition).
No change in behavior.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::availableAlignmentSpaceForFlexItem):
(WebCore::RenderFlexibleBox::marginBoxAscentForFlexItem):
(WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedFlexItem):
(WebCore::RenderFlexibleBox::crossSizeForFlexLines):
(WebCore::RenderFlexibleBox::handleCrossAxisAlignmentForFlexItems):
(WebCore::RenderFlexibleBox::performBaselineAlignment):
Canonical link: https://commits.webkit.org/316980@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications