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