WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
103916
MutationObservers should be passed unique MutationRecords
https://bugs.webkit.org/show_bug.cgi?id=103916
Summary
MutationObservers should be passed unique MutationRecords
Adam Klein
Reported
2012-12-03 12:20:32 PST
This is per a change to the DOM spec: see
https://www.w3.org/Bugs/Public/show_bug.cgi?id=20131
and
https://github.com/whatwg/dom/commit/b5d05659b682b2560af6c24e2e2cdbace82811d3
To minimize the memory impact/mutation-time cost, we could create these unique records only at delivery time (when we're already walking through the list of records to move them from a WTF::Vector to a JS array). Or if we want to get fancy we could build machinery to give each observer its own JS wrapper around a single record.
Attachments
Add attachment
proposed patch, testcase, etc.
William J. Edney
Comment 1
2015-01-08 11:43:09 PST
This bug really caused me a lot of confusion. I have a long-lived MO that observes changes on the #document node (observing both childList and subtree, of course). I wondered why I was seeing a lot of the same Mutation Records over and over again (and this list grows as my app runs). For now, I mark these objects with an expando slot to let me know the record has already been processed, but this should be unnecessary (and it's wildly inefficient to be called with records I've already processed).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug