Commit 2e15a2c1 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Invalidate cached FilterData on SVG resource containers as well

We create the effect nodes for resource containers as well - which can
instantiate FilterData - so we need to invalidate it when the filter
content changes too.

Bug: 1151610
Change-Id: Ic4ef00b1ee7b0e44cd9237bca5683996e787e91c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2554544Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#830252}
parent 47ccb304
......@@ -659,14 +659,15 @@ void SVGElementResourceClient::ResourceContentChanged(
LayoutObject* layout_object = element_->GetLayoutObject();
if (!layout_object)
return;
if (invalidation_mask & SVGResourceClient::kFilterCacheInvalidation)
InvalidateFilterData();
if (layout_object->IsSVGResourceContainer()) {
To<LayoutSVGResourceContainer>(layout_object)->RemoveAllClientsFromCache();
return;
}
if (invalidation_mask & SVGResourceClient::kFilterCacheInvalidation)
InvalidateFilterData();
if (invalidation_mask & SVGResourceClient::kPaintInvalidation) {
// Since LayoutSVGInlineTexts don't have SVGResources (they use their
// parent's), they will not be notified of changes to paint servers. So
......
<!doctype html>
<html class='test-wait'>
<title>Mutating a filter primitive in a filter that isn't used doesn't crash</title>
<link rel='help' href='https://drafts.fxtf.org/filter-effects/#FilterProperty'>
<link rel='bookmark' href='https://crbug.com/1151610'>
<script src='/common/rendering-utils.js'></script>
<svg>
<filter id='f'>
<feDiffuseLighting id='dl' lighting-color='currentcolor'/>
</filter>
<clipPath id='c' filter='url(#f)'>
<rect width='100' height='100'/>
</clipPath>
<rect width='500' height='500' fill='green' clip-path='url(#c)'/>
</svg>
<script>
waitForAtLeastOneFrame().then(() => {
var primitive = document.getElementById('dl');
primitive.parentNode.appendChild(primitive);
primitive.setAttribute('lighting-color', 'blue');
document.documentElement.classList.remove('test-wait');
});
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment