| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> | 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script src="script-tests/undefined-null-stringify.js"></script> | 7 <script> |
| 8 description( |
| 9 "This tests that the querySelector, querySelectorAll and matchesSelector (webkit
MatchesSelector) correctly stringify null and undefined to \"null\" and \"undefi
ned\"." |
| 10 ); |
| 11 |
| 12 var root = document.createElement('div'); |
| 13 var nullNode = document.createElement('null'); |
| 14 root.appendChild(nullNode); |
| 15 var undefinedNode = document.createElement('undefined'); |
| 16 root.appendChild(undefinedNode); |
| 17 document.body.appendChild(root); |
| 18 |
| 19 shouldBe("document.querySelector(null)", "nullNode"); |
| 20 shouldBe("document.querySelector(undefined)", "undefinedNode"); |
| 21 |
| 22 shouldBe("document.querySelectorAll(null).length", "1"); |
| 23 shouldBe("document.querySelectorAll(null).item(0)", "nullNode"); |
| 24 shouldBe("document.querySelectorAll(undefined).length", "1"); |
| 25 shouldBe("document.querySelectorAll(undefined).item(0)", "undefinedNode"); |
| 26 |
| 27 shouldBeTrue("nullNode.webkitMatchesSelector(null)"); |
| 28 shouldBeTrue("undefinedNode.webkitMatchesSelector(undefined)"); |
| 29 </script> |
| 8 </body> | 30 </body> |
| 9 </html> | 31 </html> |
| OLD | NEW |