Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 11cd7d5c664c482fca317a7217fcd10b76852698
https://github.com/WebKit/WebKit/commit/11cd7d5c664c482fca317a7217fcd10b76852698
Author: Ahmad Saleem <[email protected]>
Date: 2026-05-25 (Mon, 25 May 2026)
Changed paths:
M
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-003-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-008-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-008.html
M Source/WebCore/rendering/RenderReplaced.h
M Source/WebCore/rendering/svg/RenderSVGRoot.cpp
M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp
Log Message:
-----------
[SVG intrinsic sizing] max-content/min-content should use viewBox aspect
ratio when intrinsic dimensions are missing
https://bugs.webkit.org/show_bug.cgi?id=312053
rdar://174568894
Reviewed by Alan Baradlay.
For SVGs with only a viewBox (no width/height attributes), the intrinsic
aspect ratio should be used when resolving intrinsic sizing keywords like
max-content and min-content.
Previously, width: max-content on such SVGs returned the default 300px
without considering the viewBox aspect ratio. Now it correctly computes
the width as defaultHeight(150) * aspectRatio. Similarly for
height: max-content, the height is computed as width / aspectRatio.
The existing '003' test exercised width: max-content on the SVG element;
the new '008' test exercises the symmetric height: max-content case.
This also moves computeReplacedLogicalHeightRespectingMinMaxHeight from
private to protected in RenderReplaced to match the already-protected
width counterpart and be used for our '008' test case.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-003-expected.txt:
Progression
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-008-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-008.html:
Added.
* Source/WebCore/rendering/RenderReplaced.h:
(WebCore::RenderReplaced::computeReplacedLogicalHeightRespectingMinMaxHeight
const):
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeReplacedLogicalWidth const):
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight const):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::computeReplacedLogicalWidth const):
(WebCore::LegacyRenderSVGRoot::computeReplacedLogicalHeight const):
Canonical link: https://commits.webkit.org/313864@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications