[webkit-changes] [WebKit/WebKit] e4d2a7: SVG clip-path is sometimes broken on stevejobsarch...
Simon Fraser
noreply at github.com
Tue Apr 18 11:20:39 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e4d2a7474950a53bd369b91a6d7210a182c07a79
https://github.com/WebKit/WebKit/commit/e4d2a7474950a53bd369b91a6d7210a182c07a79
Author: Simon Fraser <simon.fraser at apple.com>
Date: 2023-04-18 (Tue, 18 Apr 2023)
Changed paths:
A LayoutTests/svg/masking/masking-with-event-region-expected.html
A LayoutTests/svg/masking/masking-with-event-region.html
M Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp
M Source/WebCore/rendering/svg/RenderSVGResourceClipper.h
Log Message:
-----------
SVG clip-path is sometimes broken on stevejobsarchive.com
https://bugs.webkit.org/show_bug.cgi?id=255577
rdar://107885344
Reviewed by Said Abou-Hallawa.
http://book.stevejobsarchive.com/ uses CSS clip-path with a reference to an SVG <clipPath> element
which contains text.
In this configuration, RenderSVGResourceClipper::applyClippingToContext() falls back to a code path
that uses an ImageBuffer as a mask, and it caches the ImageBuffer between calls. This caused a
problem when DOM Rendering in the GPU Process was enabled; this code is first hit for a "fake" paint
with a NullGraphicsContext which is updating EventRegions, called out of
`RenderLayerBacking::updateEventRegion()`. The NullGraphicsContext will make a local ImageBuffer.
If we then hit this same code for actual painting with a painting GraphicsContext, we'll use that
cached ImageBuffer, rather than creating a new one with appropriate GPU Process backing.
Fix this by adding `isPaintingDisabled` to the criteria used to decide if the cached buffer can be
re-used.
* LayoutTests/svg/masking/masking-with-event-region-expected.html: Added.
* LayoutTests/svg/masking/masking-with-event-region.html: Added.
* Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::computeInputs):
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* Source/WebCore/rendering/svg/RenderSVGResourceClipper.h:
(WebCore::ClipperData::Inputs::operator== const):
Canonical link: https://commits.webkit.org/263087@main
More information about the webkit-changes
mailing list