| <!doctype html> |
| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <div style="display:none" id="test"> |
| <div> |
| <p class="ng" id="target">Cocoa and Cappuccino make us happy.</p> |
| </div> |
| </div> |
| </body> |
| <script> |
| description('This test makes sure that querySelector with pseudo-element doesn\'t match anything.'); |
| var target = document.getElementById('target'); |
| shouldBe('document.querySelectorAll("#test p").length', '1'); |
| shouldBe('document.querySelector("#test p")', 'target'); |
| shouldBe('document.querySelectorAll("#test p.ng").length', '1'); |
| shouldBe('document.querySelector("#test p.ng")', 'target'); |
| |
| shouldBe('document.querySelectorAll("#test div p").length', '1'); |
| shouldBe('document.querySelector("#test div p")', 'target'); |
| shouldBe('document.querySelectorAll("#test div p.ng").length', '1'); |
| shouldBe('document.querySelector("#test div p.ng")', 'target'); |
| |
| shouldBe('document.querySelectorAll("#test p:first-line").length', '0'); |
| shouldBeNull('document.querySelector("#test p:first-line")'); |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </html> |