Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 96eae58972a85900b99139da99d64c69ae9a2201
      
https://github.com/WebKit/WebKit/commit/96eae58972a85900b99139da99d64c69ae9a2201
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-06-04 (Thu, 04 Jun 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-008-expected.txt
    M Source/WebCore/rendering/svg/RenderSVGRoot.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp

  Log Message:
  -----------
  [SVG intrinsic sizing] height: max-content uses default width instead of the 
used width when only a viewBox is present
https://bugs.webkit.org/show_bug.cgi?id=316299
rdar://178712792

Reviewed by Alan Baradlay.

Follow-up to 313864@main. When an SVG has only a viewBox and resolves an
intrinsic height keyword (e.g. height: max-content), we derived the height
from the 300px default width via the aspect ratio, ignoring the used width.
The upstream svg-intrinsic-size-008.html synced in 314370@main expects the
"Just viewBox" case (height:max-content in a 400x400 block) to be 400x100,
but we produced 300x75 and this is also expected [1] & [2]:

Use the estimated used width when provided, otherwise contentBoxLogicalWidth(),
mirroring RenderReplaced::computeReplacedLogicalHeight.

[1] https://github.com/w3c/csswg-drafts/issues/13149#issuecomment-4569048300
[2] https://github.com/w3c/csswg-drafts/issues/13149#issuecomment-4146914054

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-sizing/svg-intrinsic-size-008-expected.txt:
 Progression
* Source/WebCore/rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeReplacedLogicalHeight const):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRoot.cpp:
(WebCore::LegacyRenderSVGRoot::computeReplacedLogicalHeight const):

Canonical link: https://commits.webkit.org/314556@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to