summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/embedded-content/the-img-element/image-compositing-change.html
blob: d3e7ee41711fbd1a02bb1c8f76c31435d52151a5 (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
31
<!DOCTYPE html>
<html class="reftest-wait">
<title>Composited images correctly re-raster when the image and bounds change</title>
<meta charset="utf-8">
<meta name=fuzzy content="maxDifference=0-150;totalPixels=0-296">
<link rel="match" href="image-compositing-change-ref.html"/>
<link rel="help" href="https://html.spec.whatwg.org/multipage/#the-img-element">
<style>
#change {
  will-change:transform;
  height:426px; width:426px;
}
</style>
<img id="change" src="image.png"></img>
<img id="original" src="../../../../images/green-16x16.png"></img>
<script>
window.onload = () => {
  requestAnimationFrame(() => {
    requestAnimationFrame(() => {
      let image = document.querySelector('#change');
      image.style.width = image.style.height = "75px";
      image.src = original.src;

      requestAnimationFrame(() => {
        document.documentElement.classList.remove("reftest-wait");
      });
    });
  });
}
</script>