diff options
Diffstat (limited to 'testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.links.html')
-rw-r--r-- | testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.links.html | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.links.html b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.links.html new file mode 100644 index 0000000000..69c7d8c52c --- /dev/null +++ b/testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.links.html @@ -0,0 +1,27 @@ +<!doctype html> +<meta charset=utf-8> +<title>Document.links</title> +<link rel="author" title="Intel" href="http://www.intel.com"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> +<div id=log></div> +<div id=test> +<a href=""></a> +<a href=""></a> +</div> +<script> +test(function() { + var div = document.getElementById("test"); + var links = document.links; + assert_true(links instanceof HTMLCollection); + assert_equals(links.length, 2); + + var a = document.createElement("a"); + a.setAttribute("href", ""); + div.appendChild(a); + assert_equals(links.length, 3); + + div.removeChild(a); + assert_equals(links.length, 2); +}, "Document.links should be a live collection"); +</script> |