Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f49762409c1c9bbf4a61ce89d5368743cbb197fb
https://github.com/WebKit/WebKit/commit/f49762409c1c9bbf4a61ce89d5368743cbb197fb
Author: Alan Baradlay <[email protected]>
Date: 2026-04-24 (Fri, 24 Apr 2026)
Changed paths:
A
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-001-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-001.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-002-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-002.html
M Source/WebCore/rendering/RenderBoxModelObject.cpp
Log Message:
-----------
Relative position percentage top/bottom should resolve when containing block
has aspect-ratio
https://bugs.webkit.org/show_bug.cgi?id=313167
Reviewed by Sammy Gill.
When a relatively positioned element has a percentage top or bottom
(e.g. top: 50%), it resolves against its containing block's height.
If the containing block has height: auto, the percentage normally
doesn't resolve (treated as 0). But if the containing block also has
an aspect-ratio and a definite width, the height IS considered definite.
The fix calls shouldComputeLogicalHeightFromAspectRatio() before
the final auto/intrinsic check. This method already handles all the
edge cases (ignored aspect-ratio, width-from-aspect-ratio, etc.)
and is ok to call here since the auto height case short-circuits
before any expensive percentage resolution.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-001-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-001.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-002-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-position/position-relative-aspect-ratio-002.html:
Added.
* Source/WebCore/rendering/RenderBoxModelObject.cpp:
(WebCore::hasDefiniteHeightByStyle):
Canonical link: https://commits.webkit.org/311942@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications