summaryrefslogtreecommitdiffstats
path: root/dom/base/test/test_bug1784187.html
blob: 6f9f782e3e3957be533deb830c4b5ffe1da1902d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1784187
-->
<head>
  <title>Test for Bug 1784187</title>
  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
  <script src="/tests/SimpleTest/SimpleTest.js"></script>
  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();

function observeTest(mutationsList) {
  for (let mutation of mutationsList) {
    for (let n of mutation.addedNodes) {
      if (n.id === 'content') {
        is(n.innerHTML.trim(), "<script><\/script>", "Comment should not have been observed.");
        SimpleTest.finish();
      }
    }
  }
}

var observer = new MutationObserver(observeTest);
observer.observe(document.body, { childList: true, subtree: true });
</script>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1784187">Mozilla Bug 1784187</a>
<p id="display"></p>
<div id="content" style="display: none">
  <script></script>
  <!-- Test comment that shouldn't be observed -->
</div>
</body>
</html>