Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5c731d46be1287633906c6e49d9fe9079d53cad9
https://github.com/WebKit/WebKit/commit/5c731d46be1287633906c6e49d9fe9079d53cad9
Author: Alan Baradlay <[email protected]>
Date: 2026-07-16 (Thu, 16 Jul 2026)
Changed paths:
M Source/WebCore/rendering/RenderFlexLayout.cpp
M Source/WebCore/rendering/RenderFlexLayout.h
Log Message:
-----------
[cleanup] Reshape the flex length resolution (9.7) to mirror
Layout::FlexLayout
https://bugs.webkit.org/show_bug.cgi?id=318624
Reviewed by Antti Koivisto.
The legacy resolve-flexible-lengths step (CSS Flexbox 9.7) had drifted in shape
from the LFC
Layout::FlexLayout::computeMainSizeForFlexItems it is meant to converge on: a
FlexSign enum, a
Vector<bool> frozen set with incrementally maintained flex-factor totals, and
sizing fields named
flexBaseContentSize / hypotheticalMainContentSize.
Rebuild resolveFlexibleLengthsForLineItems as the four spec steps in
Layout::FlexLayout's shape and
naming: an OrderedHashSet nonFrozenSet, a free space recomputed each pass,
shouldUseFlexGrowFactor,
and minimum/maximum violation lists. Rename the FlexBaseAndHypotheticalMainSize
fields to flexBase /
hypotheticalMainSize, delete the now-unused FlexSign enum, and drop the dead
remaining-free-space
return (the function is now void). computeMainSizeForFlexItems stays a thin
per-line loop because the
multi-line column re-resolve reuses the per-line function, which the formatting
context does not need.
The arithmetic deliberately keeps the legacy numerics (double flex-factor
accumulators, and
LayoutUnit::fromFloatRound of each distributed share) so the result is provably
1-to-1: the freeze
condition is equivalent because the hypothetical main size is exactly the flex
base clamped by min
and max, the recomputed free space is bit-identical to the old incremental
value because LayoutUnit
is exact fixed-point, and the distribution rounds each share the same way.
Align the pipeline's list vocabulary with the formatting context throughout,
since these are the spec
terms: the per-item flex base and hypothetical main sizes become
flexBaseAndHypotheticalMainSizeList
(rather than sizingList), per-item size lists take a flexItems prefix
(flexItemsMainSizeList,
flexItemsCrossSizeList, flexItemsHypotheticalCrossSizeList,
flexItemsCrossOffsetList) and per-line
lists a flexLines prefix (flexLinesCrossSizeList, flexLinesCrossPositionList),
and each line's cross
placement is named a position rather than an offset.
No change in behavior.
* Source/WebCore/rendering/RenderFlexLayout.cpp:
* Source/WebCore/rendering/RenderFlexLayout.h:
Canonical link: https://commits.webkit.org/317337@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications