зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1533964 [wpt PR 15683] - Improve tainting for filter primitives, a=testonly
Automatic update from web-platform-tests Improve tainting for filter primitives This makes tainting for many filter primitives less pessimistic, by implementing the "Tainted Filter Primitives" section [1] from the specification. For feFlood/feDropShadow: A value of 'currentcolor' for 'flood-color' taints. For feSpecularLighting/feDiffuseLighting: A value of 'currentcolor' for 'lighting-color' taints. For the other primitives (which currently lack any specific logic), i.e: feBlend, feComponentTransfer, feComposite, feConvolveMatrix, feDisplacementMap, feGaussianBlur, feMorphology, feOffset and feTile no local tainting is performed (the TaintsOrigin() override is returning false). The signature/convention of the TaintsOrigin() is changed by removing the |inputs_taint_origin| argument, and always taint the primitive if it (the flag returned by FilterEffect::InputsTaintOrigin) is true. This saves each primitive to have to relate to this flag. (For primitives that have no inputs this flag would always be false regardless.) This means that TaintsOrigin() for each primitive is now essentially computing the "local" tainting state. [1] https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives Bug: 792518 Change-Id: Ie2d45eeb1ae8478009b88b8b87b3c4c325ede306 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503257 Commit-Queue: Fredrik Söderquist <fs@opera.com> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/master@{#638546} -- wpt-commits: 41a36beff1e1145e756f4c1d505ff7c67785f2af wpt-pr: 15683
This commit is contained in:
Родитель
2fccd25632
Коммит
8c831a7154
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
<div style="width: 50px; height: 100px; background-color: blue; border-left: 50px solid green"></div>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feBlend: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="blend_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feBlend/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#blend_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feBlend: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="blend_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feBlend/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#blend_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feComponentTransfer: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="compxfer_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feComponentTransfer/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#compxfer_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feComponentTransfer: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="compxfer_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feComponentTransfer/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#compxfer_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feComposite: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="composite_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feComposite/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#composite_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feComposite: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="composite_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feComposite/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#composite_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feConvolveMatrix: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="convolve_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feConvolveMatrix order="1" kernelMatrix="1"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#convolve_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feConvolveMatrix: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="convolve_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feConvolveMatrix order="1" kernelMatrix="1"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#convolve_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDiffuseLighting: no tainting with regular <color> lighting-color</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="diffuse_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood/>
|
||||
<feDiffuseLighting lighting-color="rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feDiffuseLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100" x="0" y="0" width="100" height="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)" filter="url(#diffuse_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDiffuseLighting: 'currentcolor' lighting-color taints the primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="diffuse_currentcolor" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood/>
|
||||
<feDiffuseLighting lighting-color="currentcolor"
|
||||
style="color: rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feDiffuseLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#diffuse_currentcolor)"/>
|
||||
</svg>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDiffuseLighting: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="diffuse_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: black"/>
|
||||
<feDiffuseLighting lighting-color="rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feDiffuseLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#diffuse_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<title>feDiffuseLighting: tainting state changes dynamically</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<svg>
|
||||
<filter id="diffuse" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood/>
|
||||
<feDiffuseLighting lighting-color="rgb(0%, 100%, 50%)"
|
||||
style="color: rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feDiffuseLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100" x="0" y="0" width="100" height="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green" filter="url(#diffuse)"/>
|
||||
</svg>
|
||||
<script>
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
document.querySelector('feDiffuseLighting').style.lightingColor = 'currentcolor';
|
||||
takeScreenshot();
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDisplacementMap: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="dispmap_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feDisplacementMap xChannelSelector="G" yChannelSelector="B"
|
||||
scale="0"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#dispmap_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDisplacementMap: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="dispmap_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feDisplacementMap xChannelSelector="G" yChannelSelector="B"
|
||||
scale="0"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#dispmap_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDropShadow: no tainting with regular <color> flood-color</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="dropshdw_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood x="0" y="0" width="100" height="100"/>
|
||||
<feDropShadow width="100%" flood-color="rgb(0%, 100%, 50%)" stdDeviation="0"
|
||||
dx="100" dy="0"/>
|
||||
<feOffset dx="-100"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100" x="0" y="0" width="100" height="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)" filter="url(#dropshdw_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDropShadow: 'currentcolor' flood-color taints the primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="dropshdw_currentcolor" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood x="0" y="0" width="100" height="100"/>
|
||||
<feDropShadow width="100%" flood-color="currentcolor" stdDeviation="0"
|
||||
dx="100" dy="0" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feOffset dx="-100"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100" x="0" y="0" width="100" height="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#dropshdw_currentcolor)"/>
|
||||
</svg>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feDropShadow: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="dropshdw_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood x="0" y="0" width="100" height="100" flood-color="currentcolor"
|
||||
style="color: black"/>
|
||||
<feDropShadow width="100%" flood-color="rgb(0%, 100%, 50%)" stdDeviation="0"
|
||||
dx="100" dy="0"/>
|
||||
<feOffset dx="-100"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100" x="0" y="0" width="100" height="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#dropshdw_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feFlood: no tainting with regular <color> flood-color</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="flood_notaint" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)" filter="url(#flood_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feFlood: 'currentcolor' flood-color taints the primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="flood_currentcolor" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#flood_currentcolor)"/>
|
||||
</svg>
|
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<title>feFlood: tainting state changes dynamically</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<script src="/common/reftest-wait.js"></script>
|
||||
<svg>
|
||||
<filter id="flood" color-interpolation-filters="sRGB">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green" filter="url(#flood)"/>
|
||||
</svg>
|
||||
<script>
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
document.querySelector('feFlood').style.floodColor = 'currentcolor';
|
||||
takeScreenshot();
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feGaussianBlur: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="gaussian_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feGaussianBlur stdDeviation="0"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#gaussian_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feGaussianBlur: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="gaussian_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feGaussianBlur stdDeviation="0"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#gaussian_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feMorphology: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="morphology_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feMorphology radius="0.5"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#morphology_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feMorphology: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="morphology_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feMorphology radius="0.5"/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#morphology_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feOffset: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="offset_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feOffset/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#offset_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feOffset: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="offset_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feOffset/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#offset_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,26 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feSpecularLighting: no tainting with regular <color> lighting-color</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="specular_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood/>
|
||||
<feSpecularLighting lighting-color="rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feSpecularLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#specular_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feSpecularLighting: 'currentcolor' lighting-color taints the primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="specular_currentcolor" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood/>
|
||||
<feSpecularLighting lighting-color="currentcolor"
|
||||
style="color: rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feSpecularLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#specular_currentcolor)"/>
|
||||
</svg>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feSpecularLighting: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="specular_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: black"/>
|
||||
<feSpecularLighting lighting-color="rgb(0%, 100%, 50%)">
|
||||
<feDistantLight elevation="90"/>
|
||||
</feSpecularLighting>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#specular_taintedinput)"/>
|
||||
</svg>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feTile: does not taint the filter chain</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-blue-stripe-100x100.html">
|
||||
<svg>
|
||||
<linearGradient id="g">
|
||||
<stop stop-color="red"/>
|
||||
<stop stop-color="red" offset=".5"/>
|
||||
<stop stop-color="green" offset=".5"/>
|
||||
<stop stop-color="green" offset="1"/>
|
||||
</linearGradient>
|
||||
<filter id="tile_notaint" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="rgb(0%, 100%, 50%)"/>
|
||||
<feTile/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="blue"/>
|
||||
<rect width="100" height="100" fill="url(#g)"
|
||||
filter="url(#tile_notaint)"/>
|
||||
</svg>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<title>feTile: propagates tainting from tainted input primitive</title>
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#tainted-filter-primitives">
|
||||
<link rel="help" href="https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions">
|
||||
<link rel="match" href="reference/green-100x100.html">
|
||||
<svg>
|
||||
<filter id="tile_taintedinput" color-interpolation-filters="sRGB"
|
||||
filterUnits="userSpaceOnUse">
|
||||
<feFlood flood-color="currentcolor" style="color: rgb(0%, 100%, 50%)"/>
|
||||
<feTile/>
|
||||
<feDisplacementMap in="SourceGraphic"
|
||||
xChannelSelector="G" yChannelSelector="B"
|
||||
scale="100"/>
|
||||
</filter>
|
||||
<rect width="100" height="100" fill="red"/>
|
||||
<rect width="100" height="100" fill="green"
|
||||
filter="url(#tile_taintedinput)"/>
|
||||
</svg>
|
Загрузка…
Ссылка в новой задаче