testing/web-platform/tests/html/dom/documents/dom-tree-accessors/document.scripts.html
author criss <ccozmuta@mozilla.com>
Thu, 19 May 2022 12:36:17 +0300
changeset 618192 ba856ffe455a3c5275f4255a5c4bce00ba5528d4
parent 415317 004007aee1cc4eb42dbed6cf0834170f4f523c82
permissions -rw-r--r--
Merge autoland to mozilla-central. a=merge

<!doctype html>
<meta charset=utf-8>
<title>Document.scripts</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>
<script>
test(function() {
  var scripts = document.scripts;
  assert_true(scripts instanceof HTMLCollection);
  assert_equals(scripts.length, 3);

  var script = document.createElement("script");
  document.body.appendChild(script);
  assert_equals(scripts.length, 4);

  document.body.removeChild(script);
  assert_equals(scripts.length, 3);
}, "Document.scripts should be a live collection");
</script>