Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 02bb8ceaac43c0f1d5b539e80a00d0604786c271
https://github.com/WebKit/WebKit/commit/02bb8ceaac43c0f1d5b539e80a00d0604786c271
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] Lay out all flex items before placing them
https://bugs.webkit.org/show_bug.cgi?id=318448
Reviewed by Antti Koivisto.
layoutAndPlaceFlexItems used to lay out each flex item (running the item's own
layout)
and then place it, one item at a time, inside the per-line loop.
Laying an item out reads only its own resolved main size and dirty bits --
never another item or the container's running height -- so it can happen for
every item up front, the way FlexLayout::layout keeps item layout as its own
phase, separate from placement.
Split it into layoutFlexItems (the child-layout pass) and placeFlexItems
(measure, align, place). layoutFlexLines now lays out every item once up front
and then places the lines. Cross-axis margin trimming, which has to run before
an item is laid out, moves into its own trimCrossAxisMarginsForFlexItems pass
ahead of the layout pass, preserving the previous trim-then-layout order. The
multiline-column redistribution path re-lays-out then re-places its lines with
the same two calls.
No change in behavior.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::distributeMainAxisFreeSpaceForMultilineColumnIfNeeded):
(WebCore::RenderFlexibleBox::trimCrossAxisMarginsForFlexItems):
(WebCore::RenderFlexibleBox::layoutFlexItems):
(WebCore::RenderFlexibleBox::layoutFlexLines):
(WebCore::RenderFlexibleBox::placeFlexItems):
(WebCore::RenderFlexibleBox::layoutColumnReverse):
(WebCore::RenderFlexibleBox::layoutAndPlaceFlexItems): Deleted.
Canonical link: https://commits.webkit.org/316803@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications