Bug 73472 - [MutationObservers] Make WebKitMutationObserver::deliverAllMutations() tolerant of re-entrant calls
Summary: [MutationObservers] Make WebKitMutationObserver::deliverAllMutations() tolera...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Rafael Weinstein
URL:
Keywords:
Depends on:
Blocks: 68729
  Show dependency treegraph
 
Reported: 2011-11-30 11:01 PST by Rafael Weinstein
Modified: 2011-11-30 21:00 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.77 KB, patch)
2011-11-30 11:06 PST, Rafael Weinstein
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Weinstein 2011-11-30 11:01:54 PST
In effect, deliverAllMutations() needs to prevent each delivery from, itself, causing deliverAllMutations().

The code happens to be structured right now in such a way that it's behavior is still semantically correct, but we should avoid having multiple calls on this static on the stack.
Comment 1 Rafael Weinstein 2011-11-30 11:06:27 PST
Created attachment 117228 [details]
Patch
Comment 2 Ojan Vafai 2011-11-30 11:10:15 PST
Comment on attachment 117228 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=117228&action=review

> Source/WebCore/dom/WebKitMutationObserver.cpp:139
> +        return;

Should we have an ASSERT_NOT_REACHED() before the return here? It's a bug in the C++ code if we ever hit this, right?
Comment 3 Rafael Weinstein 2011-11-30 11:19:35 PST
No. We probably will reach it. deliveryAllMutations is likely going to invoke script for each observer. The easiest thing is for each embedder to simply hook ALL outer-most script invocations. This guard just means that for each delivery, the embedder will *try* and quietly fail to re-start delivery (which is already underway).
Comment 4 WebKit Review Bot 2011-11-30 21:00:16 PST
Comment on attachment 117228 [details]
Patch

Clearing flags on attachment: 117228

Committed r101597: <http://trac.webkit.org/changeset/101597>
Comment 5 WebKit Review Bot 2011-11-30 21:00:20 PST
All reviewed patches have been landed.  Closing bug.