Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE HTML>
<html>
<!--
-->
<head>
<title>Test for Bug 1784187</title>
<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>
<p id="display"></p>
<div id="content" style="display: none">
<script></script>
<!-- Test comment that shouldn't be observed -->
</div>
</body>
</html>