Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/moveBefore/tentative/mutation-events.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Mutation events are suppressed during moveBefore()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<p id=reference>reference</p>
<p id=target>target</p>
<script>
const reference = document.querySelector('#reference');
const target = document.querySelector('#target');
test(() => {
target.addEventListener('DOMNodeInserted', () => assert_unreached('DOMNodeInserted not called'));
target.addEventListener('DOMNodeRemoved', () => assert_unreached('DOMNodeRemoved not called'));
document.body.moveBefore(target, reference);
}, "MutationEvents (if supported by the UA) are suppressed during `moveBefore()`");
</script>
</body>