[MutationObservers] Enforce a consistent order of MutationRecord delivery
Created attachment 130713 [details] Patch
The exact ordering is currently specified in http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-mo-invoke, but I've suggested a change to the algorithm to match this patch in http://lists.w3.org/Archives/Public/www-dom/2012JanMar/0145.html.
This is now ready for review.
Comment on attachment 130713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130713&action=review > Source/WebCore/dom/WebKitMutationObserver.h:98 > + int m_priority; Are you at all worried about overflow? At the least, this should probably be unsigned, no?
Comment on attachment 130713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130713&action=review >> Source/WebCore/dom/WebKitMutationObserver.h:98 >> + int m_priority; > > Are you at all worried about overflow? At the least, this should probably be unsigned, no? I find it unlikely that a renderer would behave reasonably having created 2 billion mutation observers. Making it unsigned doesn't help much (if you've already created 2 billion, why not another 2 billion?). If you think this is something that we should worry about, perhaps a completely different implementation (something better matching the spec, perhaps) could be in order: keeping a list of all living mutation observers, and iterating over that for delivery. But that will behave poorly if we have lots of observers only a few of which are active at a time.
Comment on attachment 130713 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=130713&action=review >>> Source/WebCore/dom/WebKitMutationObserver.h:98 >>> + int m_priority; >> >> Are you at all worried about overflow? At the least, this should probably be unsigned, no? > > I find it unlikely that a renderer would behave reasonably having created 2 billion mutation observers. Making it unsigned doesn't help much (if you've already created 2 billion, why not another 2 billion?). > > If you think this is something that we should worry about, perhaps a completely different implementation (something better matching the spec, perhaps) could be in order: keeping a list of all living mutation observers, and iterating over that for delivery. But that will behave poorly if we have lots of observers only a few of which are active at a time. As per offline discussion, making this unsigned and punting overflow.
Created attachment 131378 [details] Patch for landing
Comment on attachment 131378 [details] Patch for landing Clearing flags on attachment: 131378 Committed r110465: <http://trac.webkit.org/changeset/110465>
All reviewed patches have been landed. Closing bug.
*** Bug 79710 has been marked as a duplicate of this bug. ***