Simplify and correct mutation delivery timing for JSC
authoradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 00:24:07 +0000 (00:24 +0000)
committeradamk@chromium.org <adamk@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 00:24:07 +0000 (00:24 +0000)
commita5378ca3d33333668374c940e15353cc3570cf82
treee20830905cdc14b9e479009bbb5a7874c5e64d4b
parent4e157324ff3ef069db230c0f7302bbbc63d5e42a
Simplify and correct mutation delivery timing for JSC
https://bugs.webkit.org/show_bug.cgi?id=78172

Reviewed by Adam Barth.

Instead of keeping a static recursion counter in JSMainThreadExecState,
simply wait for a state change from non-null ExecState to null ExecState.
Because s_mainThreadState is initially null, this equivalent to
waiting for s_recursionLevel to rewind to zero.

This also properly handles the usage of JSMainThreadNullState (and
does not do mutation delivery), since that class is only used by
non-JS bindings. Now fast/mutation/end-of-task-delivery.html properly
fails, whereas it was passing before due to usage of the ObjC DOM API
from DumpRenderTree.

* bindings/js/JSMainThreadExecState.cpp:
(WebCore):
* bindings/js/JSMainThreadExecState.h: Added a comment explaining the purpose of JSMainThreadNullState.
(WebCore::JSMainThreadExecState::JSMainThreadExecState):
(WebCore::JSMainThreadExecState::~JSMainThreadExecState):
(JSMainThreadExecState):
(WebCore):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSMainThreadExecState.cpp
Source/WebCore/bindings/js/JSMainThreadExecState.h