summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-transforms/transform-box/view-box-mutation-002.html
blob: d18d823409c9d43c137d6a2edc7853dc9c96068b (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
<!doctype html>
<html class="reftest-wait">
<title>transform-box: view-box, viewport mutated, &lt;text></title>
<link rel="stylesheet" href="/fonts/ahem.css">
<link rel="match" href="reference/greensquare200x200.html">
<link rel="help" href="https://drafts.csswg.org/css-transforms/#transform-box">
<script src="/common/reftest-wait.js"></script>
<script src="/common/rendering-utils.js"></script>
<style>
#target {
  transform-box: view-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"/>
  <text id="target" x="100" y="160" fill="green"
        font-family="Ahem" font-size="200">X</text>
</svg>
<script>
  waitForAtLeastOneFrame().then(() => {
    document.querySelector('svg').setAttribute('width', 200);
    takeScreenshot();
  });
</script>