2 "This tests that the querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) correctly stringify null and undefined to \"null\" and \"undefined\"."
5 var root
= document
.createElement('div');
6 var nullNode
= document
.createElement('null');
7 root
.appendChild(nullNode
);
8 var undefinedNode
= document
.createElement('undefined');
9 root
.appendChild(undefinedNode
);
10 document
.body
.appendChild(root
);
12 shouldBe("document.querySelector(null)", "nullNode");
13 shouldBe("document.querySelector(undefined)", "undefinedNode");
15 shouldBe("document.querySelectorAll(null).length", "1");
16 shouldBe("document.querySelectorAll(null).item(0)", "nullNode");
17 shouldBe("document.querySelectorAll(undefined).length", "1");
18 shouldBe("document.querySelectorAll(undefined).item(0)", "undefinedNode");
20 shouldBeTrue("nullNode.webkitMatchesSelector(null)");
21 shouldBeTrue("undefinedNode.webkitMatchesSelector(undefined)");