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>
Created attachment 355381 [details] Fixes the bug
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.
(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.
Committed r238429: <https://trac.webkit.org/changeset/238429>
<rdar://problem/46204294>