RESOLVED FIXED 191874
Mutation observers doesn't get notified of character data mutation made by the parser
https://bugs.webkit.org/show_bug.cgi?id=191874
Summary Mutation observers doesn't get notified of character data mutation made by th...
Ryosuke Niwa
Reported 2018-11-20 20:55:13 PST
When MutationObserver is observing a text node e.g. via a subtree observation, and the HTML parser appends more data to it, the observer never gets invoked with mutation records of the character data mutation made by the parser. <rdar://problem/42477645>
Attachments
Fixes the bug (4.63 KB, patch)
2018-11-20 20:57 PST, Ryosuke Niwa
koivisto: review+
Ryosuke Niwa
Comment 1 2018-11-20 20:57:26 PST
Created attachment 355381 [details] Fixes the bug
Antti Koivisto
Comment 2 2018-11-21 01:26:51 PST
Comment on attachment 355381 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=355381&action=review > Source/WebCore/dom/CharacterData.cpp:102 > + String oldData; > + if (UNLIKELY(mutationRecipients)) > + oldData = m_data; Maybe just set oldData unconditionally? It is not clear that a branch is faster than minor ref churn.
Ryosuke Niwa
Comment 3 2018-11-21 13:24:17 PST
(In reply to Antti Koivisto from comment #2) > Comment on attachment 355381 [details] > Fixes the bug > > View in context: > https://bugs.webkit.org/attachment.cgi?id=355381&action=review > > > Source/WebCore/dom/CharacterData.cpp:102 > > + String oldData; > > + if (UNLIKELY(mutationRecipients)) > > + oldData = m_data; > > Maybe just set oldData unconditionally? It is not clear that a branch is > faster than minor ref churn. Okay. I guess we'd catch it on perf bots if it regressed perf.
Ryosuke Niwa
Comment 4 2018-11-21 13:33:51 PST
Radar WebKit Bug Importer
Comment 5 2018-11-21 13:34:29 PST
Note You need to log in before you can comment on or make changes to this bug.