wpt / svg / styling / use-element-attr-selector.html

Status: FAIL | Duration: 14ms | Subtests: 0/1 | Open test on wpt.live | Open ref on wpt.live | wpt.fyi

/svg/styling/use-element-attr-selector.html

<!DOCTYPE html>
<html class="reftest-wait">
<title>SVG Test: Attribute change in template affects attribute selector matching in &lt;use&gt; element tree</title>
<link rel="help" href="https://w3c.github.io/svgwg/svg2-draft/struct.html#UseElement">
<link rel="match" href="use-element-selector-ref.html">
<style>
  [attr] > #rect { fill: green; }
</style>
<svg>
  <use id="use_elm" xlink:href="#tmpl" />
  <defs>
    <g id="tmpl">
      <rect id="rect" width="100" height="100"></rect>
    </g>
  </defs>
</svg>
<script>
  requestAnimationFrame(() => {
    requestAnimationFrame(() => {
      tmpl.setAttribute("attr", "val");
      document.documentElement.classList.remove('reftest-wait');
    });
  });
</script>

/svg/styling/use-element-selector-ref.html

<!DOCTYPE html>
<title>SVG Test Reference</title>
<svg>
  <rect width="100" height="100" fill="green"></rect>
</svg>