Changeset 102424 in webkit


Ignore:
Timestamp:
Dec 8, 2011 8:19:48 PM (12 years ago)
Author:
adamk@chromium.org
Message:

[MutationObservers] V8LazyEventHandler breaks microtask delivery semantics
https://bugs.webkit.org/show_bug.cgi?id=73492

Reviewed by Adam Barth.

Source/WebCore:

Test: fast/mutation/inline-event-listener.html

  • bindings/v8/V8LazyEventListener.cpp:

(WebCore::V8LazyEventListener::prepareListenerObject): Call v8::Script::Run directly instead of going through V8Proxy.

Tools:

Add eventSender.scheduleAsynchronousKeyDown, needed to cause a
keypress event without any script on the stack.

  • DumpRenderTree/chromium/EventSender.cpp:

(EventSender::EventSender):
(EventSender::keyDown):
(KeyDownTask::KeyDownTask):
(KeyDownTask::runIfValid):
(EventSender::scheduleAsynchronousKeyDown):

  • DumpRenderTree/chromium/EventSender.h:

LayoutTests:

  • fast/mutation/inline-event-listener-expected.txt: Added.
  • fast/mutation/inline-event-listener.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r102423 r102424  
     12011-12-08  Adam Klein  <adamk@chromium.org>
     2
     3        [MutationObservers] V8LazyEventHandler breaks microtask delivery semantics
     4        https://bugs.webkit.org/show_bug.cgi?id=73492
     5
     6        Reviewed by Adam Barth.
     7
     8        * fast/mutation/inline-event-listener-expected.txt: Added.
     9        * fast/mutation/inline-event-listener.html: Added.
     10
    1112011-12-08  Hayato Ito  <hayato@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r102423 r102424  
     12011-12-08  Adam Klein  <adamk@chromium.org>
     2
     3        [MutationObservers] V8LazyEventHandler breaks microtask delivery semantics
     4        https://bugs.webkit.org/show_bug.cgi?id=73492
     5
     6        Reviewed by Adam Barth.
     7
     8        Test: fast/mutation/inline-event-listener.html
     9
     10        * bindings/v8/V8LazyEventListener.cpp:
     11        (WebCore::V8LazyEventListener::prepareListenerObject): Call v8::Script::Run directly instead of going through V8Proxy.
     12
    1132011-12-08  Hayato Ito  <hayato@chromium.org>
    214
  • trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp

    r101480 r102424  
    124124    v8::Handle<v8::Script> script = V8Proxy::compileScript(codeExternalString, m_sourceURL, m_position);
    125125    if (!script.IsEmpty()) {
    126         v8::Local<v8::Value> value = proxy->runScript(script);
     126        // Call v8::Script::Run() directly to avoid an erroneous call to V8RecursionScope::didLeaveScriptContext().
     127        // FIXME: Remove this code when we stop doing the 'with' hack above.
     128        v8::Local<v8::Value> value = script->Run();
    127129        if (!value.IsEmpty()) {
    128130            ASSERT(value->IsFunction());
  • trunk/Tools/ChangeLog

    r102420 r102424  
     12011-12-08  Adam Klein  <adamk@chromium.org>
     2
     3        [MutationObservers] V8LazyEventHandler breaks microtask delivery semantics
     4        https://bugs.webkit.org/show_bug.cgi?id=73492
     5
     6        Reviewed by Adam Barth.
     7
     8        Add eventSender.scheduleAsynchronousKeyDown, needed to cause a
     9        keypress event without any script on the stack.
     10
     11        * DumpRenderTree/chromium/EventSender.cpp:
     12        (EventSender::EventSender):
     13        (EventSender::keyDown):
     14        (KeyDownTask::KeyDownTask):
     15        (KeyDownTask::runIfValid):
     16        (EventSender::scheduleAsynchronousKeyDown):
     17        * DumpRenderTree/chromium/EventSender.h:
     18
    1192011-12-08  Hayato Ito  <hayato@chromium.org>
    220
  • trunk/Tools/DumpRenderTree/chromium/EventSender.cpp

    r102044 r102424  
    271271    bindMethod("releaseTouchPoint", &EventSender::releaseTouchPoint);
    272272    bindMethod("scheduleAsynchronousClick", &EventSender::scheduleAsynchronousClick);
     273    bindMethod("scheduleAsynchronousKeyDown", &EventSender::scheduleAsynchronousKeyDown);
    273274    bindMethod("setTouchModifier", &EventSender::setTouchModifier);
    274275    bindMethod("textZoomIn", &EventSender::textZoomIn);
     
    501502void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result)
    502503{
    503     result->setNull();
     504    if (result)
     505        result->setNull();
    504506    if (arguments.size() < 1 || !arguments[0].isString())
    505507        return;
     
    848850}
    849851
     852class KeyDownTask : public MethodTask<EventSender> {
     853public:
     854    KeyDownTask(EventSender* obj, const CppArgumentList& arg)
     855        : MethodTask<EventSender>(obj), m_arguments(arg) { }
     856    virtual void runIfValid() { m_object->keyDown(m_arguments, 0); }
     857
     858private:
     859    CppArgumentList m_arguments;
     860};
     861
     862void EventSender::scheduleAsynchronousKeyDown(const CppArgumentList& arguments, CppVariant* result)
     863{
     864    result->setNull();
     865    postTask(new KeyDownTask(this, arguments));
     866}
     867
    850868void EventSender::beginDragWithFiles(const CppArgumentList& arguments, CppVariant* result)
    851869{
  • trunk/Tools/DumpRenderTree/chromium/EventSender.h

    r102044 r102424  
    8383    void continuousMouseScrollBy(const CppArgumentList&, CppVariant*);
    8484    void scheduleAsynchronousClick(const CppArgumentList&, CppVariant*);
     85    void scheduleAsynchronousKeyDown(const CppArgumentList&, CppVariant*);
    8586    void beginDragWithFiles(const CppArgumentList&, CppVariant*);
    8687    CppVariant dragMode;
Note: See TracChangeset for help on using the changeset viewer.