Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: dcd4b73b90f77551735d3834896d53420335cd02
https://github.com/WebKit/WebKit/commit/dcd4b73b90f77551735d3834896d53420335cd02
Author: Alan Baradlay <[email protected]>
Date: 2026-05-22 (Fri, 22 May 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-cross-size-002-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-cross-size-002-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-cross-size-002.html
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
[Flex] Stretch-fit width with aspect-ratio should not provide definite cross
size to flex items
https://bugs.webkit.org/show_bug.cgi?id=315254
Reviewed by Antti Koivisto.
<div style="width: 200px">
<div style="display: flex; aspect-ratio: 4">
<div style="display: flex; aspect-ratio: 1">
<div>
<div style="height: 100%; aspect-ratio: 2"></div>
</div>
</div>
</div>
</div>
The outer flex should be 200x50 (width 200 from the block, height 200/4
from aspect-ratio). Instead it grew to 200x110: the deepest percent-
height descendant inflated the flex item's preferred width, which fed
back into the outer's automatic minimum height.
313256@main marked any flex container with auto cross size and aspect-ratio
as having a definite cross size during layout, setting a cross-axis
override on the flex item. The override unblocked the descendant
percent-height resolution, which the inner aspect-ratio transferred to
inline size, inflating the flex item's preferred width.
CSS Sizing 3 section 5.1 defines a definite size as one "that can be
determined without performing layout". A style-fixed width plus aspect-
ratio meets that from style alone; a stretch-fit width is only resolved
during layout. Narrow the check to require a style-fixed logical width.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-cross-size-002-expected.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-cross-size-002-ref.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-aspect-ratio-cross-size-002.html:
Added.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
* Source/WebCore/rendering/RenderFlexibleBox.h:
Canonical link: https://commits.webkit.org/313723@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications