OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <html> |
| 3 <head> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 <script> |
| 6 if (window.testRunner) |
| 7 testRunner.dumpAsText(); |
| 8 </script> |
| 9 </head> |
| 10 <body> |
| 11 <sibling></sibling> |
| 12 <target id="theTarget" webkit="fast"></target> |
| 13 </body> |
| 14 <script> |
| 15 description('This test makes sure that :scope works correctly with the closest()
API.'); |
| 16 |
| 17 var theTarget = document.getElementById('theTarget'); |
| 18 var body = document.body; |
| 19 |
| 20 shouldBe('theTarget.closest(":scope")', 'theTarget'); |
| 21 shouldBe('theTarget.closest(":not(:scope)")', 'body'); |
| 22 |
| 23 shouldBe('theTarget.closest("body :scope")', 'theTarget'); |
| 24 shouldBe('theTarget.closest("body > :scope")', 'theTarget'); |
| 25 shouldBeNull('theTarget.closest("body:scope")'); |
| 26 |
| 27 shouldBe('theTarget.closest("sibling + :scope")', 'theTarget'); |
| 28 shouldBe('theTarget.closest("sibling ~ :scope")', 'theTarget'); |
| 29 |
| 30 shouldBe('theTarget.closest("#theTarget:scope")', 'theTarget'); |
| 31 shouldBe('theTarget.closest(":scope#theTarget")', 'theTarget'); |
| 32 |
| 33 shouldBe('theTarget.closest("[webkit]:scope#theTarget")', 'theTarget'); |
| 34 shouldBeNull('theTarget.closest(":not([webkit=fast]):scope#theTarget")'); |
| 35 |
| 36 shouldBeNull('theTarget.closest(":scope target")'); |
| 37 shouldBeNull('theTarget.closest(":scope > target")'); |
| 38 shouldBeNull('theTarget.closest(":scope + target")'); |
| 39 shouldBeNull('theTarget.closest(":scope ~ target")'); |
| 40 |
| 41 shouldBeNull('theTarget.closest(":scope *")'); |
| 42 shouldBeNull('theTarget.closest(":scope > *")'); |
| 43 shouldBeNull('theTarget.closest(":scope + *")'); |
| 44 shouldBeNull('theTarget.closest(":scope ~ *")'); |
| 45 </script> |
| 46 </html> |
OLD | NEW |