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

  Changed paths:
    M Source/WebCore/html/HTMLCanvasElement.cpp
    M Source/WebCore/html/HTMLCanvasElement.h
    M Source/WebCore/platform/graphics/Image.h
    M Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleCachedImage.h
    M Source/WebCore/style/values/images/kinds/StyleCanvasImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleCanvasImage.h
    M Source/WebCore/style/values/images/kinds/StyleFilterImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleFilterImage.h
    M Source/WebCore/style/values/images/kinds/StyleImage.cpp
    M Source/WebCore/style/values/images/kinds/StyleImage.h
    M Source/WebCore/svg/graphics/SVGImage.h

  Log Message:
  -----------
  [Image Redux] Each Style::Image kind should pass in the size its resolved 
image is drawn at
https://bugs.webkit.org/show_bug.cgi?id=326838

Reviewed by Darin Adler.

Replaces helpers in Style::Image that explicitly checked for the SVG image type 
to compute resolved image
sizes with passing in the size from the callers.

For two of those callers, Style::CanvasImage and Style::FilterImage, that is 
trivial with a bit of type
updating to keep their resolved image's BitmapImages which always know their 
own size.

For Style::CachedImage, where the resolved image can be any kind of 
WebCore::Image, we replace the explicit
`drawsSVGImage()` check with a new `usesConcreteObjectSizeAsViewport()`, which 
is what the SVG image check
really wanted to know. This allows SVG images (or others that return true for 
usesConcreteObjectSizeAsViewport()
in the future, something we may want to do with PDFs), to avoid drawing at a 
small size and than scaling,
and instead always drawing at the full size.

* Source/WebCore/html/HTMLCanvasElement.cpp:
* Source/WebCore/html/HTMLCanvasElement.h:
* Source/WebCore/platform/graphics/Image.h:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCachedImage.h:
* Source/WebCore/style/values/images/kinds/StyleCanvasImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleCanvasImage.h:
* Source/WebCore/style/values/images/kinds/StyleFilterImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleFilterImage.h:
* Source/WebCore/style/values/images/kinds/StyleImage.cpp:
* Source/WebCore/style/values/images/kinds/StyleImage.h:
* Source/WebCore/svg/graphics/SVGImage.h:

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



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

Reply via email to