Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 92c8bad208280bd3355b4c387cefea629fca0f7d
https://github.com/WebKit/WebKit/commit/92c8bad208280bd3355b4c387cefea629fca0f7d
Author: Alan Baradlay <[email protected]>
Date: 2026-05-25 (Mon, 25 May 2026)
Changed paths:
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[cleanup] Extract layoutFlexItemAfterMainSizing helper from
layoutAndPlaceFlexItems in RenderFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=315458
Reviewed by Antti Koivisto.
layoutAndPlaceFlexItems's per-item loop body contained roughly thirty lines
that conceptually did one thing: take a flex item whose flexedContentSize
has already been determined by the flex algorithm, apply that size as an
overriding main extent, mark the necessary dirty bits, run layoutIfNeeded,
and do the first-time repaint check. That block was wedged between
ASSERT(!isOutOfFlowPositioned()) and updateAutoMarginsInMainAxis, so the
loop read as one large mix of sizing, dirty-bit handling, layout, and
cross-axis placement.
Extracted that block into a new helper, layoutFlexItemAfterMainSizing,
named after the phase it occupies: by the time we get here,
resolveFlexibleLengthsForLineItems has computed each item's used main size
and the helper's job is to apply it and lay the item out. The caller is
now a single line, and the rest of the loop is clearly the cross-axis
placement work.
No behavior change.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutAndPlaceFlexItems):
(WebCore::RenderFlexibleBox::layoutFlexItemAfterMainSizing):
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/313861@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications