Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5fa6b028303501f2ac41d2ad2f278f76bbc930c6
https://github.com/WebKit/WebKit/commit/5fa6b028303501f2ac41d2ad2f278f76bbc930c6
Author: Issac Roy <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
M Source/WebCore/layout/formattingContexts/flex/FlexLineBreaker.cpp
Log Message:
-----------
[Flex Wrap Balance] balancedLineBreaks should return early when flexLineCount
>= itemCount
https://bugs.webkit.org/show_bug.cgi?id=325009
Reviewed by Alan Baradlay.
When `flex-line-count` asks for at least as many lines as there are items, the
answer is already determined: a flex line holds at least one item, so covering
`itemCount` items in at least `itemCount` lines leaves one item per line and no
competing partition to score it against.
`balancedLineBreaks` still allocated `minScores` and `bestEndForStart` and ran
the full three-deep loop to rediscover that, in the widest shape it ever takes,
since the line axis runs all the way to `itemCount`.
Return those breaks directly. `minimumLineCount` is then redundant: past the
early return `flexLineCount` is below `itemCount` and so already the smaller of
the two, and the loop bound, the `index` stride and the table sizes read the
parameter instead.
* Source/WebCore/layout/formattingContexts/flex/FlexLineBreaker.cpp:
(WebCore::balancedLineBreaks):
Canonical link: https://commits.webkit.org/321813@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications