Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a3d2b19de1762775a0db3494b2171356a53aa304
https://github.com/WebKit/WebKit/commit/a3d2b19de1762775a0db3494b2171356a53aa304
Author: Taher Ali <[email protected]>
Date: 2026-08-24 (Mon, 24 Aug 2026)
Changed paths:
M Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
M Source/WebCore/platform/graphics/BitmapImage.cpp
M Source/WebCore/platform/graphics/Image.cpp
M Source/WebCore/platform/graphics/Image.h
M Source/WebCore/svg/graphics/SVGImage.cpp
Log Message:
-----------
Image observer save/restore should be scope-bound
https://bugs.webkit.org/show_bug.cgi?id=322460
rdar://185746232
Reviewed by Simon Fraser.
Call sites temporarily clear an image's observer and restore it manually.
Because restoration re-reads a mutable image variable, reassignment or
an early exit can leave the CachedImage without its observer permanently.
Introduce a small RAII guard that binds the image so restoration is tied to the
originally bound image and guaranteed on every exit path.
No behavior change.
* Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* Source/WebCore/platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawLuminanceMaskPattern):
* Source/WebCore/platform/graphics/Image.cpp:
(WebCore::ImageObserverDisableScope::ImageObserverDisableScope):
(WebCore::ImageObserverDisableScope::~ImageObserverDisableScope):
* Source/WebCore/platform/graphics/Image.h:
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawForContainer):
(WebCore::SVGImage::nativeImage):
Canonical link: https://commits.webkit.org/319766@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications