Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7009b52f456d3f48ffb28bab32adbcfe386b2730
https://github.com/WebKit/WebKit/commit/7009b52f456d3f48ffb28bab32adbcfe386b2730
Author: Sammy Gill <[email protected]>
Date: 2026-05-19 (Tue, 19 May 2026)
Changed paths:
M LayoutTests/TestExpectations
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-011-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-011.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-012-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-012-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-012.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-013-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-013-ref.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-013.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-014-expected.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/aspect-ratio-intrinsic-size-014.html
M Source/WebCore/rendering/RenderBlockFlow.cpp
M Source/WebCore/rendering/RenderFlexibleBox.cpp
M Source/WebCore/rendering/RenderFlexibleBox.h
Log Message:
-----------
Flex container's preferred widths become stale when its parent's height
changes
https://bugs.webkit.org/show_bug.cgi?id=230151
rdar://83240099
Reviewed by Alan Baradlay.
A block (e.g. shrink-to-fit / min-content) with a flex container child
whose height is a percentage of the block can render at the wrong width
when the block's height changes. If the flex container has a stretched
aspect-ratio item, the container's intrinsic width depends on its own
cross size: during preferred-widths computation the container propagates
its cross size to the item as an overriding size, and the item's
aspect-ratio derives its inline size from that override.
The cached preferred widths on the flex container were never invalidated
when the parent's height changed, so callers (e.g. the parent's min-content
width resolution) read a stale value.
Add some additional logic in
RenderBlockFlow::dirtyForLayoutFromPercentageHeightDescendant
that basically attempts to detect this case by asking the formatting
context root if its preferred widths depends on its own height.
For now we only handle flex containers in this patch along with some
testcases that demonstrate the problem. If we find any other formatting
contexts that share this issue when its content has aspect-ratio, or
even if we find some other type of content in any FC that can trigger
this dependency, we can extend this function to cover those cases.
Canonical link: https://commits.webkit.org/313536@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications