summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/text/reftests/transform-dynamic-change.html
blob: 57b5551061945931b39f35394e2974b2306e2762 (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
32
33
34
35
36
37
<!DOCTYPE html>
<html class="reftest-wait">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1270713">
<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1271931">
<link rel="match" href="transform-dynamic-change-ref.html">
<body>

<div id="moveme" style="position:absolute; transform-origin: 0px 0px; transform: matrix(0.3, 0, 0, 0.3, 136, 13);">
  <svg width="2384" height="1684" style="position:absolute; left:0; top:0;">
    <circle cx="475" cy="975" r="40" stroke="black" stroke-width="2" fill="none" />
    <text id="txt" style="font-size: 40px;" transform="matrix(1, 0, 0, 1, 468, 988)">A</text>
  </svg>
  <svg width="2384" height="1684" style="position:absolute; left:0; top:200px;">
    <circle cx="475" cy="975" r="40" stroke="black" stroke-width="2" fill="none" />
    <text style="font-size: 40px;" transform="matrix(1, 0, 0, 1, 468, 988)"><tspan id="inline">B</tspan></text>
  </svg>
</div>

<svg id="svg2" width="500" height="400" style="transform-origin: 0px 0px; transform: translate(-300px, -300px);">
  <text x="300" y="350" id="text2" font-size="50">PASS</text>
</svg>

<script>
requestAnimationFrame(() => {
  requestAnimationFrame(() => {
    document.getElementById('moveme').style.transform = 'matrix(0.9, 0, 0, 0.9, -210, -777)';
    document.getElementById('txt').style.fill = 'red';
    document.getElementById('inline').style.fill = 'blue';

    document.getElementById('svg2').style.transform = 'scale(2) translate(-300px, -300px)';
    document.getElementById('text2').style.fill = 'green';
    document.documentElement.classList.remove('reftest-wait');
  });
});
</script>
</body>
</html>