summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transforms/transform-box/fill-box-mutation-002.html
blob: 676d5cdd03b25ce2c5d25df03237819196fa1a66 (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
<!DOCTYPE html>
<html class="reftest-wait">
<title>transform-box: fill-box, image mutated</title>
<link rel="match" href="reference/greensquare200x200.html">
<link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-box">
<style>
#target {
  transform-box: fill-box;
  transform: translate(-50%, 0);
}
</style>
<p>There should be a green 200x200 rectangle below, and no red.</p>
<svg width="400" height="200">
  <rect width="200" height="200" fill="red"/>
  <image id="target" x="100" width="100" height="200"
         href="/css/css-transforms/support/1x1-green.png"/>
</svg>
<script>
requestAnimationFrame(function() {
  requestAnimationFrame(function() {
    document.querySelector('#target').setAttribute('width', 200);
    document.documentElement.classList.remove('reftest-wait');
  });
});
</script>