testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.links.html
author Mozilla Releng Treescript <release+treescript@mozilla.org>
Thu, 19 May 2022 06:57:01 +0000
changeset 618144 e602ffeedb64dca5837700381558bdc070f4a7b3
parent 415317 004007aee1cc4eb42dbed6cf0834170f4f523c82
permissions -rw-r--r--
no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD el -> edacbc72f9c702472e006c7229d01e89ac68a0a0 es-AR -> ca52c046fef480523988cdf8b2c316b4084b496c he -> e7c0b94abeb7ee044af286e4ebd622ada0804c2e hye -> fb27399463e03658d760751802e4c655e9a1f787 ia -> 63dea35c49da07c0d7f3ab2f77e2e0682868a737 ka -> 0f521d52f508aa416fda2178642ef9ce0b3bc417 nb-NO -> a453d24c602fd86656e5c1488dff8ab24ac31765 nl -> 77e9f18a051887619223c2f41af62f91a8ce8a86 oc -> 106f94e19e078d7449c9191176eab1c2d99174f4 pt-BR -> affa7ab77d516392d7a5d41d4cd75c19db2ba65c rm -> f8ebda3f7a4c0aa71b312e4b28f14c8ca08c5fca tg -> 2d54aae5a06ed5c4e12bbd18fd54b78b5d5ae1b6

<!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>