Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e8115e13871b666b8d1bf0a885cf45ab5c80e00b
      
https://github.com/WebKit/WebKit/commit/e8115e13871b666b8d1bf0a885cf45ab5c80e00b
  Author: Sam Weinig <[email protected]>
  Date:   2026-10-13 (Tue, 13 Oct 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only.html
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderImage.h
    M Source/WebCore/rendering/RenderReplaced.cpp
    M Source/WebCore/rendering/RenderReplaced.h

  Log Message:
  -----------
  [Image Redux] Use replacedContentRect() consistently in RenderImage
https://bugs.webkit.org/show_bug.cgi?id=327310

Reviewed by Darin Adler.

We can stop using contentRect() in RenderImage when hasNaturalAspectRatio() is 
false now that replacedContentRect()
works on the natural dimensions and can handle that case just fine. To remove 
all uses, computePaintRectForObjectViewBox()
also had to be updated to use natural dimensions.

Making everything going through replacedContentRect() also fixes another edge 
case of an SVG with only a width
using 'object-fit: none' or 'object-fit: scale-down'.

Test: 
imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only.html
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-images/object-fit-none-svg-width-only.html:
 Added.
* Source/WebCore/rendering/RenderImage.cpp:
* Source/WebCore/rendering/RenderImage.h:
* Source/WebCore/rendering/RenderReplaced.cpp:
* Source/WebCore/rendering/RenderReplaced.h:

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



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

Reply via email to