Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox considering text node valueChanged as added/removed node in Mutation Observer #18

Open
gudipati opened this issue Oct 21, 2015 · 0 comments

Comments

@gudipati
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant