Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/styling/use-element-attr-selector.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<title>SVG Test: Attribute change in template affects attribute selector matching in <use> element tree</title>
<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>