wpt / css / css-viewport / zoom / text-indent-svg.html

Status: PASS | Duration: 6ms | Subtests: 1/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/css/css-viewport/zoom/text-indent-svg.html

<!DOCTYPE html>
<title>CSS zoom does not apply to text-indent on SVG primitives when specified and inherited</title>
<link rel="help" href="https://drafts.csswg.org/css-viewport/">
<link rel="match" href="reference/text-indent-svg-ref.html">

<style>
.indent {
  text-indent: 1rem;
}
.zoom {
  zoom: 2;
}
</style>

<svg width="150" height="30">
  <text class="indent" x="0" y="20">unzoomed</text>
</svg>

<div class="zoom">
  <svg width="150" height="30">
    <text class="indent" x="0" y="20">zoomed</text>
  </svg>
</div>

/css/css-viewport/zoom/reference/text-indent-svg-ref.html

<!DOCTYPE html>
<style>
html {
  --scale: 1;
}
.indent {
  text-indent: calc(1rem * var(--scale));
}
.zoom {
  --scale: 2;
}
</style>

<svg width="150" height="30">
  <text class="indent" x="0" y="20">unzoomed</text>
</svg>

<div class="zoom">
  <svg width="300" height="60">
    <text style="font-size: calc(1rem * var(--scale))" class="indent" x="0" y="40">zoomed</text>
  </svg>
</div>