Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 2730e165d67592f16e0ce56bc52b43a4100df8b8
https://github.com/WebKit/WebKit/commit/2730e165d67592f16e0ce56bc52b43a4100df8b8
Author: Alan Baradlay <[email protected]>
Date: 2026-09-24 (Thu, 24 Sep 2026)
Changed paths:
A
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-expected.txt
A
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-quirks-expected.txt
A
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-quirks.html
A
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout.html
M Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp
M Source/WebCore/rendering/RenderBox.cpp
Log Message:
-----------
REGRESSION (Safari 27, 311579@main): percentage flex-basis in nested column
flex containers makes subtree layout exponential in nesting depth (page freezes)
https://bugs.webkit.org/show_bug.cgi?id=324434
<rdar://problem/187727635>
Reviewed by Simon Fraser.
Resolving a percentage inside nested indefinite column flexboxes walks up the
flex ancestors, which can be
rather expensive with deeply nested content. This patch eliminates some of
these ancestor walks.
1. Both flexItemMainSizeIsDefinite and
canResolvePercentAgainstContainerBlockSize walk the ancestors, but for
a percentage or stretch flex-basis they answer the same question, so
hasDefiniteSizeForPercentResolution only needs the latter (see comment).
2. In quirks mode, skipContainingBlockForPercentHeightCalculation runs twice
per ancestor and, since 311739@main,
starts with canUseFlexItemForPercentageResolution, which is another walk.
The other checks can only return false, so check it last.
Tests:
fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-quirks.html
fast/flexbox/percentage-flex-basis-nested-column-subtree-layout.html
*
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-expected.txt:
Added.
*
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-quirks-expected.txt:
Added.
*
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout-quirks.html:
Added.
*
LayoutTests/fast/flexbox/percentage-flex-basis-nested-column-subtree-layout.html:
Added.
* Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp:
(WebCore::LayoutIntegration::FlexLayout::hasDefiniteSizeForPercentResolution):
* Source/WebCore/rendering/RenderBox.cpp:
(WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const):
Canonical link: https://commits.webkit.org/321866@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications