Skip to content

Truly independent web browser

745 B
Raw Blame
<!DOCTYPE html>
<html class="reftest-wait">
<title>SVG Test: Class change in template affects class selector matching in &lt;use&gt; element tree</title>
<link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElement">
<link rel="match" href="../../../../expected/wpt-import/svg/styling/use-element-selector-ref.html">
<style>
  .class > #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("class", "class");
      document.documentElement.classList.remove('reftest-wait');
    });
  });
</script>