Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1eee13b1ae998cecf58430b48755b2c163d97e18
https://github.com/WebKit/WebKit/commit/1eee13b1ae998cecf58430b48755b2c163d97e18
Author: Ahmad Saleem <[email protected]>
Date: 2026-02-25 (Wed, 25 Feb 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/rendering/RenderReplaced.cpp
Log Message:
-----------
Fix transferred min/max constraints inflating percentage-default zero
intrinsic dimensions
https://bugs.webkit.org/show_bug.cgi?id=308075
rdar://170765025
Reviewed by Alan Baradlay.
When an SVG image has a percentage-based width or height (the default
"100%" when the attribute is omitted), the intrinsic dimension is
reported as 0. The transferred min/max constraint logic in
computeIntrinsicSizesConstrainedByTransferredMinMaxSizes was applying
min-height/min-width via the aspect ratio to clamp these zeros upward,
making the dimension appear intrinsic and causing the wrong sizing path
to be taken.
For example, an SVG with only an intrinsic height of 25px and a 2:1
ratio would get its zero intrinsic width clamped to 40px via a
transferred min-height: 20px, producing 40x20 instead of the correct
50x25.
Fix by skipping the min-constraint when the dimension is zero, since
zero here means "no intrinsic dimension" rather than an explicit zero.
Max-constraints are still applied unconditionally as they can only
shrink non-zero values.
* Source/WebCore/rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computeIntrinsicSizesConstrainedByTransferredMinMaxSizes):
* LayoutTests/TestExpectations: Progressions
Canonical link: https://commits.webkit.org/308212@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications