Commit 7c52f886 authored by ap@webkit.org's avatar ap@webkit.org

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.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c08fcca8
2008-10-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=21921
MessagePort messages are dispatched to documents that are not fully active
* fast/events/message-port-inactive-document.html: Protect the document from being
destructed in a working way (a global variable named "document" didn't do the trick due
to its name).
2008-10-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
......
......@@ -22,12 +22,12 @@ if (window.layoutTestController) {
layoutTestController.waitUntilDone();
}
var document;
var otherDocument;
var mainPort;
function test()
{
document = window.frames[0].document;
otherDocument = window.frames[0].document;
var channel = new MessageChannel;
window.frames[0].postMessage("msg", channel.port2, "*");
mainPort = channel.port1;
......
2008-10-29 Alexey Proskuryakov <ap@webkit.org>
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.
2008-10-29 Alexey Proskuryakov <ap@webkit.org>
Reviewed by Sam Weinig.
......
......@@ -61,6 +61,10 @@ void JSAbstractEventListener::handleEvent(Event* event, bool isWindowEvent)
Frame* frame = window->impl()->frame();
if (!frame)
return;
// The window must still be active in its frame. See <https://bugs.webkit.org/show_bug.cgi?id=21921>.
// FIXME: A better fix for this may be to change DMOWindow::frame() to not return a frame the detached window used to be in.
if (frame->domWindow() != window->impl())
return;
ScriptController* script = frame->script();
if (!script->isEnabled() || script->isPaused())
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment