| Index: third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html
|
| index ca88de8f15c5630ff0b8ab4626ca859d54e147bd..98a494fbe9b00711de191c0b8a472a31929cf144 100644
|
| --- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html
|
| +++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot.html
|
| @@ -4,6 +4,24 @@
|
| <script src="../../../resources/js-test.js"></script>
|
| </head>
|
| <body>
|
| -<script src="script-tests/elementRoot.js"></script>
|
| +<script>
|
| +description(
|
| +"This tests that querySelector and querySelectorAll don't search outside their root node."
|
| +);
|
| +
|
| +var root = document.createElement('div');
|
| +var correctNode = document.createElement('div');
|
| +root.appendChild(correctNode);
|
| +document.body.appendChild(root);
|
| +var noChild = document.createElement('div');
|
| +document.body.appendChild(noChild);
|
| +
|
| +shouldBe("root.querySelector('div')", "correctNode");
|
| +shouldBe("root.querySelectorAll('div').length", "1");
|
| +shouldBe("root.querySelectorAll('div').item(0)", "correctNode");
|
| +
|
| +shouldBeNull("noChild.querySelector('div')");
|
| +shouldBe("noChild.querySelectorAll('div').length", "0");
|
| +</script>
|
| </body>
|
| </html>
|
|
|