| Index: third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html
|
| index d422c827b04de3663b0b4a4b61a0a4b0b78aab31..cebc4a5306f0695bddb34eae7b7930f6d774ecc0 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element.html
|
| @@ -4,6 +4,30 @@
|
| <script src="../../../resources/js-test.js"></script>
|
| </head>
|
| <body>
|
| -<script src="script-tests/detached-element.js"></script>
|
| +<script>
|
| +description(
|
| +"This tests that querySelector, querySelectorAll and matchesSelector (webkitMatchesSelector) work with elements that are not in a document yet."
|
| +);
|
| +
|
| +var root = document.createElement('div');
|
| +var correctNode = document.createElement('div');
|
| +correctNode.setAttribute("id", "testId")
|
| +root.appendChild(correctNode);
|
| +var noChild = document.createElement('div');
|
| +
|
| +shouldBe("root.querySelector('div')", "correctNode");
|
| +shouldBe("root.querySelector('#testId')", "correctNode");
|
| +
|
| +shouldBe("root.querySelectorAll('div').length", "1");
|
| +shouldBe("root.querySelectorAll('div').item(0)", "correctNode");
|
| +shouldBe("root.querySelectorAll('#testId').length", "1");
|
| +shouldBe("root.querySelectorAll('#testId').item(0)", "correctNode");
|
| +
|
| +shouldBeNull("noChild.querySelector('div')");
|
| +shouldBe("noChild.querySelectorAll('div').length", "0");
|
| +
|
| +shouldBeTrue("correctNode.webkitMatchesSelector('div')");
|
| +shouldBeTrue("correctNode.webkitMatchesSelector('#testId')");
|
| +</script>
|
| </body>
|
| </html>
|
|
|