Bug 1804517 [wpt PR 37383] - Invalidate ancestor-chain in FilterPrimitiveChanged(), a=testonly

Automatic update from web-platform-tests
Invalidate ancestor-chain in FilterPrimitiveChanged()

Since a descendant of a resource - for example a <mask> - can reference
a <filter> we need to walk up the ancestor chain to look for resources.

Factor out parts of LayoutSVGResourceContainer's
MarkForLayoutAndParentResourceInvalidation() into separate helpers
(InvalidateAncestorChainResources() and InvalidateDependentElements())
so that they can be called from the FilterPrimitiveChanged() handler.

Fixed: 1297837
Change-Id: I203b2087a441c1cb564f6f44e58e93c38237af1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4085050
Auto-Submit: Fredrik Söderquist <fs@opera.com>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Reviewed-by: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1081214}

--

wpt-commits: 68dd1e3b016a4e6385f725219b944ec5747696a2
wpt-pr: 37383
This commit is contained in:
Fredrik Söderquist 2022-12-11 21:38:21 +00:00 committed by moz-wptsync-bot
parent afb82f5d92
commit a8c64f2f3f

View File

@ -0,0 +1,32 @@
<!doctype html>
<html class="reftest-wait">
<title>Mutating filter primitive in &lt;filter> referenced by &lt;mask></title>
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#FilterElement">
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#feColorMatrixElement">
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#feComponentTransferElement">
<link rel="help" href="https://drafts.fxtf.org/css-masking-1/#svg-masks">
<link rel="match" href="reference/green-100x100.html">
<svg>
<filter id="filter" color-interpolation-filters="sRGB">
<feColorMatrix type="hueRotate" values="0"/>
<feComponentTransfer>
<feFuncG type="linear" slope="10000"/>
</feComponentTransfer>
<feColorMatrix type="matrix" values="0 1 0 0 0, 0 1 0 0 0, 0 1 0 0 0, 0 0 0 1 0"/>
</filter>
<mask id="mask">
<rect width="100%" height="100%" fill="red" filter="url(#filter)"/>
</mask>
<rect width="100" height="100" fill="red"/>
<rect width="100" height="100" fill="green" mask="url(#mask)"/>
</svg>
<script>
waitForAtLeastOneFrame().then(() => {
document.querySelector('svg > filter > feColorMatrix').setAttribute('values', 90);
takeScreenshot();
});
</script>