Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d1da8666babf1ef9236dbe54d59d0760067a6df8
https://github.com/WebKit/WebKit/commit/d1da8666babf1ef9236dbe54d59d0760067a6df8
Author: Alan Baradlay <[email protected]>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[cleanup] Compute all flex line cross sizes before placing any items
https://bugs.webkit.org/show_bug.cgi?id=318451
Reviewed by Antti Koivisto.
layoutFlexLines measured each line's cross size and placed that line's items in
one loop, so cross sizing and placement were interleaved line by line.
Measuring a line reads only the items' laid-out geometry, never their positions,
and row-flow placement never reads the container height that measuring grows --
so every line can be measured before any line is placed.
Move the measurement loop into computeCrossSizeForFlexLines, which builds all
the line states (cross-axis offset, cross extent, baseline sharing groups) up
front. layoutFlexLines then runs a placement-only loop over those line states,
and placeFlexItems drops its return value. This is the FlexLayout::layout shape,
where line cross sizing is its own pass ahead of placement.
No change in behavior.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeCrossSizeForFlexLines):
(WebCore::RenderFlexibleBox::layoutFlexLines):
(WebCore::RenderFlexibleBox::placeFlexItems):
Canonical link: https://commits.webkit.org/316818@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications