use-element-id-selector.html (721B)
1 <!DOCTYPE html> 2 <html class="reftest-wait"> 3 <title>SVG Test: Id change in template affects id selector matching in <use> element tree</title> 4 <link rel="help" href="https://svgwg.org/svg2-draft/struct.html#UseElement"> 5 <link rel="match" href="use-element-selector-ref.html"> 6 <style> 7 #id > #rect { fill: green; } 8 </style> 9 <svg> 10 <use id="use_elm" xlink:href="#tmpl" /> 11 <defs> 12 <g id="tmpl"> 13 <g id="no_id"> 14 <rect id="rect" width="100" height="100"></rect> 15 </g> 16 </g> 17 </defs> 18 </svg> 19 <script> 20 requestAnimationFrame(() => { 21 requestAnimationFrame(() => { 22 no_id.setAttribute("id", "id"); 23 document.documentElement.classList.remove('reftest-wait'); 24 }); 25 }); 26 </script>