I encountered this issue during the development: Nodes found by a characterData query may not be text nodes. They can be comment nodes, or their parent nodes can be <style> and <script>.
Maybe this is by design. document.CreateTreeWalker() also has similar behaviors.
Rafael Weinstein
unread,
Apr 27, 2012, 9:42:17 PM4/27/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mutation-sum...@googlegroups.com
Glad to hear you're using it!
So, yes, characterData query will return all types of characterData
nodes, which may (as you point out) be children of style or script.
I suppose we could add API to the query so specify what *type* of
characterData node, but the MutationSummary still has to listen for
all types and it would just do the same simple filter that you're
likely already doing.