4 <script src=
"../../../resources/js-test.js"></script>
10 <div class=
"target"></div>
13 <div class=
"target"></div>
16 <div id=
"test2" class=
"target">line
4</div>
17 <div id=
"test3"></div>
20 <pre id=
"console"></pre>
22 NodeList
.prototype.dump = function()
25 var length
= this.length
;
26 for (var i
= 0; i
< length
; i
++)
27 result
+= this[i
] + ", ";
28 result
+= "length: " + length
;
32 function testQuerySelectorAll(node
, selectorString
)
35 return node
.querySelectorAll(selectorString
).dump();
41 shouldBeEqualToString('testQuerySelectorAll(document, ".target + div")', "[object HTMLDivElement], [object HTMLDivElement], length: 2");
42 shouldBeEqualToString('testQuerySelectorAll(document.getElementById("test"), ".target + div")', "[object HTMLDivElement], [object HTMLDivElement], length: 2");
43 shouldBeEqualToString('testQuerySelectorAll(document.getElementById("test2"), ".target + div")', "length: 0");
44 shouldBeEqualToString('testQuerySelectorAll(document.getElementById("test3"), ".target + div")', "length: 0");