2 <title>Test for bug
1531333</title>
3 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
4 <link rel=
"stylesheet" href=
"/tests/SimpleTest/test.css">
6 symbol { display: block }
8 <svg xmlns=
"http://www.w3.org/2000/svg" xmlns:
xlink=
"http://www.w3.org/1999/xlink" width=
"10" height=
"10">
9 <symbol id=
"svg-sprite" viewBox=
"0 0 133 230866">
10 <title>svg-sprite
</title>
11 <symbol id=
"svg-sprite" viewBox=
"0 0 133 230866">
12 <title>svg-sprite
</title>
13 <use xlink:
href=
"#svg-sprite" width=
"500" height=
"500" />
15 <use xlink:
href=
"#svg-sprite" y=
"1601" width=
"133" height=
"228958" />
17 <use xlink:
href=
"#svg-sprite" y=
"1601" width=
"133" height=
"230866" />
20 function countUseElements(subtreeRoot
) {
25 for (const use of subtreeRoot
.querySelectorAll("use"))
26 i
+= 1 + countUseElements(SpecialPowers
.wrap(use).openOrClosedShadowRoot
);
29 SimpleTest
.waitForExplicitFinish();
31 document
.body
.offsetTop
;
32 // The three in the document, plus the two created from the element that's
33 // not in the <symbol> subtree.
34 is(countUseElements(document
), 5, "Shouldn't create more than 5 use elements");