Skip to content

Commit

Permalink
DOM: Suppress mutation events during moveBefore()
Browse files Browse the repository at this point in the history
[email protected]

Bug: 40150299
Change-Id: I70dffea4c1c81c5a12285949b7112624f7e3ff8a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5797545
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Dominic Farolino <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1343986}
  • Loading branch information
domfarolino authored and chromium-wpt-export-bot committed Aug 20, 2024
1 parent 6bfec39 commit 2eb5c22
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dom/nodes/moveBefore/tentative/mutation-events.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!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>

0 comments on commit 2eb5c22

Please sign in to comment.