Steps to reproduce
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.
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.”