Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: bb73179461ca2425ae7c0ec77e6be50f156d0550
https://github.com/WebKit/WebKit/commit/bb73179461ca2425ae7c0ec77e6be50f156d0550
Author: Alan Baradlay <[email protected]>
Date: 2026-07-12 (Sun, 12 Jul 2026)
Changed paths:
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[cleanup] Inline the flex-length freeze helpers into
resolveFlexibleLengthsForLineItems
https://bugs.webkit.org/show_bug.cgi?id=318558
Reviewed by Antti Koivisto.
resolveFlexibleLengthsForLineItems drove the CSS Flexbox 9.7 resolution through
three separate methods -- freezeInflexibleItems, resolveFlexibleLengths, and
freezeViolations -- threading the same bookkeeping (the frozen flags, the
running
remainingFreeSpace, and the totalFlexGrow / totalFlexShrink /
totalWeightedFlexShrink
sums) between them by reference. FlexLayout::layout resolves the flexible
lengths
inline in a single function. Fold the three helpers into
resolveFlexibleLengthsForLineItems
to match: freezeViolations becomes a local lambda over the same locals, the
inflexible-item freeze runs inline before the loop, and resolveFlexibleLengths
becomes the body of a while (true) loop.
No change in behavior: this is pure code motion. The lambda captures the same
locals the helpers took by reference; the inflexible freeze still runs before
initialFreeSpace is captured; and while (!resolveFlexibleLengths(...)) {} with
its
internal "if (totalViolation) freeze; else remainingFreeSpace -= usedFreeSpace;
return !totalViolation" is exactly while (true) { ...; if (!totalViolation) {
remainingFreeSpace -= usedFreeSpace; break; } freeze; } -- same distribution,
same
clamping, same freeze order, same termination.
* Source/WebCore/rendering/RenderFlexibleBox.h:
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::resolveFlexibleLengthsForLineItems):
(WebCore::RenderFlexibleBox::freezeViolations): Deleted.
(WebCore::RenderFlexibleBox::freezeInflexibleItems): Deleted.
(WebCore::RenderFlexibleBox::resolveFlexibleLengths): Deleted.
Canonical link: https://commits.webkit.org/317010@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications