RESOLVED FIXED 160712
CharacterData.data setter optimization is not spec-compliant and is observable
https://bugs.webkit.org/show_bug.cgi?id=160712
Summary CharacterData.data setter optimization is not spec-compliant and is observable
Chris Dumez
Reported 2016-08-09 15:33:34 PDT
We have an optimization in CharacterData.setData() that avoid doing any work if the new data is identical to the old data. However, this optimization is not spec-compliant: - https://dom.spec.whatwg.org/#dom-characterdata-data This is an issue because this is observable using DOM mutation observer or ranges.
Attachments
Patch (390.30 KB, patch)
2016-08-09 15:44 PDT, Chris Dumez
no flags
Patch (390.49 KB, patch)
2016-08-09 16:14 PDT, Chris Dumez
no flags
Patch (391.29 KB, patch)
2016-08-09 16:48 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2016-08-09 15:44:05 PDT
Ryosuke Niwa
Comment 2 2016-08-09 15:53:42 PDT
Comment on attachment 285682 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=285682&action=review > Source/WebCore/dom/CharacterData.cpp:44 > + auto& document = node.document(); > + return !document.hasListenerType(Document::DOMCHARACTERDATAMODIFIED_LISTENER) && !document.hasMutationObserversOfType(MutationObserver::CharacterData); We also need to check subtreemodified event. > Source/WebCore/dom/CharacterData.cpp:53 > + document().textRemoved(this, 0, oldLength); We also need to call document().frame()->selection().textWasReplaced to be consistent.
Chris Dumez
Comment 3 2016-08-09 16:14:06 PDT
Chris Dumez
Comment 4 2016-08-09 16:48:51 PDT
WebKit Commit Bot
Comment 5 2016-08-09 17:11:53 PDT
Comment on attachment 285689 [details] Patch Clearing flags on attachment: 285689 Committed r204316: <http://trac.webkit.org/changeset/204316>
WebKit Commit Bot
Comment 6 2016-08-09 17:11:58 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.