summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/ParentNode-children.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/ParentNode-children.html')
-rw-r--r--testing/web-platform/tests/dom/nodes/ParentNode-children.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/ParentNode-children.html b/testing/web-platform/tests/dom/nodes/ParentNode-children.html
new file mode 100644
index 0000000000..6621e7d9de
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/ParentNode-children.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>ParentNode.children</title>
+<link rel=help href="https://dom.spec.whatwg.org/#dom-parentnode-children">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="log"></div>
+<div style="display: none">
+ <ul><li id='test'>1</li><li>2</li><li>3</li><li>4</li></ul>
+</div>
+<script>
+test(() => {
+ var node = document.getElementById("test");
+ var parentNode = node.parentNode;
+ var children = parentNode.children;
+ assert_true(children instanceof HTMLCollection);
+ var li = document.createElement("li");
+ assert_equals(children.length, 4);
+
+ parentNode.appendChild(li);
+ assert_equals(children.length, 5);
+
+ parentNode.removeChild(li);
+ assert_equals(children.length, 4);
+}, "ParentNode.children should be a live collection");
+</script>
+</html>