Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/sharing-in-svg-use.html - WPT Dashboard Interop Dashboard
<!doctype html>
<title>CSS Test: nth-of-type should work in an svg use subtree</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="match" href="sharing-in-svg-use-ref.html">
<style>
rect:nth-of-type(1) {
fill: blue;
}
rect:nth-of-type(2) {
fill: purple;
}
</style>
<!-- Should see two different colors -->
<svg width="200" height="100">
<defs>
<g id="p0">
<rect width="100" height="100" />
<rect x="100" y="0" width="100" height="100" />
</g>
</defs>
<use href="#p0" x="0" y="0" />
</svg>