Skip to content

Commit b4ff91d

Browse files
mattwoodrowwebkit-commit-queue
authored andcommitted
Don't include SVGImageForContainers in allCachedSVGImages
https://bugs.webkit.org/show_bug.cgi?id=234364 Patch by Matt Woodrow <mattwoodrow@apple.com> on 2021-12-20 Reviewed by Dean Jackson. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::image const): (WebCore::CachedImage::hasSVGImage const): (WebCore::CachedImage::image): Deleted. * loader/cache/CachedImage.h: Canonical link: https://commits.webkit.org/245438@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 485d0da commit b4ff91d

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

Source/WebCore/ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
2021-12-20 Matt Woodrow <mattwoodrow@apple.com>
2+
3+
Don't include SVGImageForContainers in allCachedSVGImages
4+
https://bugs.webkit.org/show_bug.cgi?id=234364
5+
6+
Reviewed by Dean Jackson.
7+
8+
* loader/cache/CachedImage.cpp:
9+
(WebCore::CachedImage::image const):
10+
(WebCore::CachedImage::hasSVGImage const):
11+
(WebCore::CachedImage::image): Deleted.
12+
* loader/cache/CachedImage.h:
13+
114
2021-12-20 Wenson Hsieh <wenson_hsieh@apple.com>
215

316
Adopt ChromeClient::classifyModalContainerControls() in ModalContainerObserver

Source/WebCore/loader/cache/CachedImage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ bool CachedImage::willPaintBrokenImage() const
235235
return errorOccurred() && m_shouldPaintBrokenImage;
236236
}
237237

238-
Image* CachedImage::image()
238+
Image* CachedImage::image() const
239239
{
240240
if (errorOccurred() && m_shouldPaintBrokenImage) {
241241
// Returning the 1x broken image is non-ideal, but we cannot reliably access the appropriate
@@ -272,7 +272,7 @@ Image* CachedImage::imageForRenderer(const RenderObject* renderer)
272272

273273
bool CachedImage::hasSVGImage() const
274274
{
275-
return m_image && m_image->drawsSVGImage();
275+
return image() && image()->isSVGImage();
276276
}
277277

278278
void CachedImage::setContainerContextForClient(const CachedImageClient& client, const LayoutSize& containerSize, float containerZoom, const URL& imageURL)

Source/WebCore/loader/cache/CachedImage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class CachedImage final : public CachedResource {
5353
CachedImage(const URL&, Image*, PAL::SessionID, const CookieJar*, const String& domainForCachePartition);
5454
virtual ~CachedImage();
5555

56-
WEBCORE_EXPORT Image* image(); // Returns the nullImage() if the image is not available yet.
56+
WEBCORE_EXPORT Image* image() const; // Returns the nullImage() if the image is not available yet.
5757
WEBCORE_EXPORT Image* imageForRenderer(const RenderObject*); // Returns the nullImage() if the image is not available yet.
5858
bool hasImage() const { return m_image.get(); }
5959
bool hasSVGImage() const;

0 commit comments

Comments
 (0)