Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b4092fa48dfdb9d870234e5fad4db4324f630e1d
      
https://github.com/WebKit/WebKit/commit/b4092fa48dfdb9d870234e5fad4db4324f630e1d
  Author: Taher Ali <[email protected]>
  Date:   2026-04-21 (Tue, 21 Apr 2026)

  Changed paths:
    M LayoutTests/TestExpectations
    M LayoutTests/platform/glib/TestExpectations
    M Source/WebCore/svg/graphics/SVGImage.cpp

  Log Message:
  -----------
  Stop suppressing SVG intrinsic aspect ratio when preserveAspectRatio is none
https://bugs.webkit.org/show_bug.cgi?id=312785
rdar://problem/175173375

Reviewed by Simon Fraser.

SVGImage::computeIntrinsicDimensions() was returning early when
preserveAspectRatio="none", skipping the viewBox-derived intrinsic
ratio. The preserveAspectRatio attribute controls how SVG content
scales within its viewport, but does not affect the intrinsic aspect
ratio of the SVG image. The viewBox always defines the intrinsic ratio
regardless of the preserveAspectRatio value.

This caused background-size resolution with auto dimensions to fail
for SVG images with incomplete intrinsic dimensions but a valid viewBox,
since the aspect ratio needed to resolve the auto dimension was never reported.

* LayoutTests/TestExpectations:

Removed 77 now-passing test expectations and added one new
failure. wide--cover--width.html uses an SVG with viewBox
"0 0 1 2147483647" — the extreme ratio collapses to zero
width in LayoutUnit precision, breaking the cover calculation.
tall--cover--height/width and wide--cover--height use similar
extreme-viewbox SVGs and were already failing.

* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::computeIntrinsicDimensions):

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



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

Reply via email to