summaryrefslogtreecommitdiffstats
path: root/dom/html/test/file_imports_basics.html
blob: 0abf4e848ffdca7a53293e8a2d2e489fb19adfde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE html>
<html lang="en-US">
  <head>
  </head>
  <body>
    <div id="foo">bar</div>
    <script>
      counter++;
      var importDone = true;
      is(document.currentScript.ownerDocument.getElementById("foo").textContent, "bar",
         "currentScript.ownerDocument works in imported document,");
      try{
        document.currentScript.ownerDocument.open();
        document.currentScript.ownerDocument.write("<h1>This should not show up!</h1>");
        document.currentScript.ownerDocument.close();
        ok(false, "document.write should have thrown (import)")
      } catch (e) {
        ok(true, "document.write has thrown (import)")
      }
    </script>
  </body>
</html>