-
Notifications
You must be signed in to change notification settings - Fork 157
Description
In Firefox, mutation observer is considering textnode content change as added and removed.
since in tree-mirror.js we process nodes that are removed first and then process the one which are added, it result in textnode getting added multiple times. In Chrome, mutation observer considers the same textnode content change as valueChanged.
CHROME:
mutations- oldValue: oldText and target:text [data: newText, nodeName:#text, nodeValue: newText]
summaries- valueChanged:text [data: newText, nodeName:#text, nodeValue: newText]
FIREFOX:
mutations- [addedNodes 0: [data: newText, nodeName:#text, nodeValue: newText], removedNodes 0: [data: oldText, nodeName:#text, nodeValue: oldText]]
summaries- [added 0: [data: newText, nodeName:#text, nodeValue: newText], removed 0: [data: oldText, nodeName:#text, nodeValue: oldText]]
We have given both childList and subtree as true. I'm guessing chrome might be giving preference to subtree and hence returning oldValue/target while firefox might be giving preference to childList hence returning added/removed node. Am I right?
How do I make sure firefox picks it up as valueChanged instead of adding+removing the textnode? Can this be fixed here itself or should I do some kind of sequencing over the messages?