4 https://bugzilla.mozilla.org/show_bug.cgi?id=667520
7 <title>Test for Bug
667520</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=667520">Mozilla Bug
667520</a>
14 <!-- important: we need a <span> as the second element child and then
15 non-span elements between that and the next </span> -->
25 <div id=
"content" style=
"display: none">
29 <script type=
"application/javascript">
31 /** Test for Bug
667520 **/
32 var spans = $(
"display").querySelectorAll(
"span");
33 is(spans.length,
3,
"Should have 3 span kids");
35 is($(
"display").querySelector(
"span:nth-child(3)"), null,
"Third child is not span");
36 is($(
"display").querySelector(
"span:nth-child(4)"), null,
"Fourth child is not span");
38 for (var i =
0; i < spans.length; ++i) {
40 /* Important: need to include 'span' in that selector so we only match
41 nth-child against spans. */
42 var target = $(
"display").querySelector(
"span:nth-child("+id+
")");
43 is(target, spans[i],
"Unexpected element");
44 is(target.id, spans[i].id,
"Unexpected id");