Mutation Observers do not coalesce Text node mutations (they appear as two records)

Confirmed Issue #14708138 • Assigned to Travis L.


Travis L.
Nov 16, 2017
This issue is public.
Found in
  • Microsoft Edge
Standard affected
DOM Standard

Found in build #
Reported by 1 person

Sign in to watch or report this issue.

Steps to reproduce

Test case:

It appears that the mutation record in Edge contains two entries for each text change: one for removing the old text node, and one for inserting the new one. All other browsers create only one record, with one addedNode and one removedNode.

From the spec it doesn’t become obvious that Edge’s behaviour is a bug, or that the behaviour of the other browsers is a bug. Nonetheless it’s a difference, and I’d like to know if there are specific reasons mutation observers work this way in Edge, or if it’s something that’s going to change.

My particular use case is distinguishing between childList mutations that actually replace element nodes and ones that only replace text. In the other browsers I can simply go through the addedNodes and removedNodes of the record, and if at least one of them is an element node the mutation as a whole was an element mutation. (In the test page I set trueType to either childList or characterData). This approach is less feasible in Edge, since I’d have to collate information from several mutation records. That’s not impossible, but I thought I’d ask you first.



0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “James M.”

      Changed Assigned To to “travil”

      Changed Status to “Confirmed”

      Changed Assigned To from “travil” to “Travis L.”

    You need to sign in to your Microsoft account to add a comment.

    Sign in