[webkit-changes] [WebKit/WebKit] d142de: ASSERTION FAILED: !image->size().isEmpty(): [ iOS, ...

Brent Fulgham noreply at github.com
Wed Apr 26 12:44:56 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d142dec43f3a5bf2ca6832f1eab1df116e38e080
      https://github.com/WebKit/WebKit/commit/d142dec43f3a5bf2ca6832f1eab1df116e38e080
  Author: Brent Fulgham <bfulgham at apple.com>
  Date:   2023-04-26 (Wed, 26 Apr 2023)

  Changed paths:
    M Source/WebCore/svg/graphics/SVGImageCache.cpp

  Log Message:
  -----------
  ASSERTION FAILED: !image->size().isEmpty(): [ iOS, macOS ] imported/w3c/web-platform-tests/css/css-backgrounds/background-size/background-size-near-zero-svg.html is a constant crash.
https://bugs.webkit.org/show_bug.cgi?id=255662
<rdar://problem/108267097>

Reviewed by Said Abou-Hallawa.

SVGImageCache::setContainerContextForClient caches an unscaled SVGImage, plus a scale factor.

It computes the size based on a LayoutSize, which is converted to a FloatSize, unscaled by
the image scaling factor, then stored for later use.

When the cached value is retrieved, it is scaled by the zoom factor, then rounded to the nearest
integer value.

This scaling and rounding process can yield an empty image, which triggers an assertion when the
image is retrieved.

Rather that store this nonsensical image, we should recognize that the image is effectively null,
and not cache it.

* Source/WebCore/svg/graphics/SVGImageCache.cpp:
(WebCore::SVGImageCache::setContainerContextForClient):

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




More information about the webkit-changes mailing list