OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../../resources/js-test.js"></script> |
| 5 </head> |
| 6 <body> |
| 7 <span id="duplicateId1"></span> |
| 8 <span id="duplicateId1"></span> |
| 9 <span id="duplicateId2"></span> |
| 10 <span id="duplicateId2"></span> |
| 11 <div id="scopeDiv"> |
| 12 <span id="duplicateId1"></span> |
| 13 <span id="duplicateId1"></span> |
| 14 <span id="duplicateId1"></span> |
| 15 <span id="duplicateId1"></span> |
| 16 </div> |
| 17 <script> |
| 18 description("Test that CSS selector queries on duplicate Ids respect sco
pe."); |
| 19 |
| 20 shouldBe("document.querySelectorAll('#duplicateId1').length", "6"); |
| 21 shouldBe("document.querySelectorAll('#duplicateId2').length", "2"); |
| 22 |
| 23 scopeDiv = document.getElementById("scopeDiv"); |
| 24 shouldBe("scopeDiv.querySelectorAll('#duplicateId1').length", "4"); |
| 25 shouldBeNull("scopeDiv.querySelector('#duplicateId2')"); |
| 26 shouldBe("scopeDiv.querySelectorAll('#duplicateId2').length", "0"); |
| 27 </script> |
| 28 </body> |
| 29 </html> |
OLD | NEW |