Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 24698a846ffd1e1d4ea4fd66e1fd943f5457a025
https://github.com/WebKit/WebKit/commit/24698a846ffd1e1d4ea4fd66e1fd943f5457a025
Author: Ahmad Saleem <[email protected]>
Date: 2026-03-29 (Sun, 29 Mar 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/RenderBlockFlow.cpp
Log Message:
-----------
Fix percent-height replaced elements computing stale preferred widths in
shrink-to-fit containers
https://bugs.webkit.org/show_bug.cgi?id=308655
rdar://171184282
Reviewed by Alan Baradlay.
When a block's height changes (e.g. a float that is a shrink-to-fit container),
dirtyForLayoutFromPercentageHeightDescendants() was called inside the do-while
layout loop, after recomputeLogicalWidthAndColumnWidth() had already committed
the block's width using stale preferred widths from percent-height descendants
with intrinsic aspect ratios.
Fix this by calling dirtyForLayoutFromPercentageHeightDescendants() before
recomputeLogicalWidthAndColumnWidth() in layoutBlock(), so that a shrink-to-fit
float picks up the fresh preferred widths of its canvas/image descendants.
Also extend dirtyForLayoutFromPercentageHeightDescendants() to recurse into
nested block flows that are themselves percent-height descendants. This handles
the case where the aspect-ratio replaced element is nested behind an
intermediate
div (e.g. #target → div[height:100%] → canvas[height:100%]): the intermediate
block's own percent-height descendant list also needs to be invalidated.
* LayoutTests/TestExpectations: Progressions
* Source/WebCore/rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::dirtyForLayoutFromPercentageHeightDescendants):
Canonical link: https://commits.webkit.org/310194@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications