Changeset 37971 in webkit


Ignore:
Timestamp:
Oct 29, 2008 3:44:22 AM (16 years ago)
Author:
ap@webkit.org
Message:

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=21921
MessagePort messages are dispatched to documents that are not fully active

Covered by corrected fast/events/message-port-inactive-document.html

  • bindings/js/JSEventListener.cpp: (WebCore::JSAbstractEventListener::handleEvent): Don't dispatch messages to contexts that are not fully active.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r37969 r37971  
     12008-10-29  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=21921
     6        MessagePort messages are dispatched to documents that are not fully active
     7
     8        * fast/events/message-port-inactive-document.html: Protect the document from being
     9        destructed in a working way (a global variable named "document" didn't do the trick due
     10        to its name).
     11
    1122008-10-29  Alexey Proskuryakov  <ap@webkit.org>
    213
  • trunk/LayoutTests/fast/events/message-port-inactive-document.html

    r36891 r37971  
    2323}
    2424
    25 var document;
     25var otherDocument;
    2626var mainPort;
    2727
    2828function test()
    2929{
    30     document = window.frames[0].document;
     30    otherDocument = window.frames[0].document;
    3131    var channel = new MessageChannel;
    3232    window.frames[0].postMessage("msg", channel.port2, "*");
  • trunk/WebCore/ChangeLog

    r37969 r37971  
     12008-10-29  Alexey Proskuryakov  <ap@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=21921
     6        MessagePort messages are dispatched to documents that are not fully active
     7
     8        Covered by corrected fast/events/message-port-inactive-document.html
     9
     10        * bindings/js/JSEventListener.cpp:
     11        (WebCore::JSAbstractEventListener::handleEvent): Don't dispatch messages to contexts
     12        that are not fully active.
     13
    1142008-10-29  Alexey Proskuryakov  <ap@webkit.org>
    215
  • trunk/WebCore/bindings/js/JSEventListener.cpp

    r37956 r37971  
    6262    if (!frame)
    6363        return;
     64    // The window must still be active in its frame. See <https://bugs.webkit.org/show_bug.cgi?id=21921>.
     65    // FIXME: A better fix for this may be to change DMOWindow::frame() to not return a frame the detached window used to be in.
     66    if (frame->domWindow() != window->impl())
     67        return;
    6468    ScriptController* script = frame->script();
    6569    if (!script->isEnabled() || script->isPaused())
Note: See TracChangeset for help on using the changeset viewer.