summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/filter-effects/svg-sourcegraphic-invalidation-001.html
blob: 2776aa50cf81977f216bfc4e51d041e132f06935 (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
<!doctype html>
<html class="reftest-wait">
<title>SourceGraphic is invalidated when removing element from the document</title>
<link rel="help" href="https://drafts.fxtf.org/filter-effects-1/#attr-valuedef-in-sourcegraphic">
<link rel="match" href="reference/green-100x100.html">
<script src="/common/rendering-utils.js"></script>
<script src="/common/reftest-wait.js"></script>
<svg>
  <filter id="f">
    <feMerge><feMergeNode/></feMerge>
  </filter>
  <rect width="100" height="100" fill="red"/>
  <rect id="target" width="50" height="100" fill="green" filter="url(#f)"/>
</svg>
<script>
  waitForAtLeastOneFrame().then(() => {
    let rect = document.getElementById('target');
    let svg = rect.parentNode;
    rect.remove();
    rect.setAttribute('width', '100');
    svg.appendChild(rect);
    takeScreenshot();
  });
</script>