2 "This tests that querySelector and querySelectorAll don't search outside their root node."
5 var root
= document
.createElement('div');
6 var correctNode
= document
.createElement('div');
7 root
.appendChild(correctNode
);
8 document
.body
.appendChild(root
);
9 var noChild
= document
.createElement('div');
10 document
.body
.appendChild(noChild
);
12 shouldBe("root.querySelector('div')", "correctNode");
13 shouldBe("root.querySelectorAll('div').length", "1");
14 shouldBe("root.querySelectorAll('div').item(0)", "correctNode");
16 shouldBeNull("noChild.querySelector('div')");
17 shouldBe("noChild.querySelectorAll('div').length", "0");