summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/filter-effects/tainting-fediffuselighting-dynamic.html
blob: 89674095a0cab68653690b543b70c3385c69d0fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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>