Bug 21921 - MessagePort messages are dispatched to documents that are not fully active
Summary: MessagePort messages are dispatched to documents that are not fully active
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh OS X 10.5
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-28 07:18 PDT by Alexey Proskuryakov
Modified: 2008-10-29 03:45 PDT (History)
1 user (show)

See Also:


Attachments
proposed fix (2.73 KB, patch)
2008-10-28 07:25 PDT, Alexey Proskuryakov
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2008-10-28 07:18:26 PDT
We have a test that is supposed to verify that this doesn't happen, but it is incorrect, as it lets the document be destroyed.
Comment 1 Alexey Proskuryakov 2008-10-28 07:25:22 PDT
Created attachment 24711 [details]
proposed fix
Comment 2 Darin Adler 2008-10-28 11:35:27 PDT
Comment on attachment 24711 [details]
proposed fix

I'm a little worried that this kind of check might be needed in more cases other than just this event listener function. Is there a way to make this change a more natural part of how you get the frame from the window in the first place? What's a good way to audit the rest of the code to se if we need other changes like this? Is there a way to change the design to fill this "crack in the foundation"?

r=me
Comment 3 Alexey Proskuryakov 2008-10-28 12:24:11 PDT
I think that DOMWindow's frame pointer should be cleared out when it stops being active, just like it is the case for Document. And going from DOMWindow to Document and back probably shouldn't involve Frame at all. In this case, this check wouldn't be necessary.

But I don't know the reasons for the current design, maybe I'm way off.
Comment 4 Darin Adler 2008-10-28 12:26:36 PDT
(In reply to comment #3)
> I think that DOMWindow's frame pointer should be cleared out when it stops
> being active, just like it is the case for Document. And going from DOMWindow
> to Document and back probably shouldn't involve Frame at all. In this case,
> this check wouldn't be necessary.

Maybe we could add a FIXME mentioning this alternate possible design. It seems fine to clear the DOMWindow's frame pointer; we just need to test to see if there are any code paths that require on it not being cleared.
Comment 5 Alexey Proskuryakov 2008-10-29 03:45:39 PDT
Committed revision 37971. Added a FIXME.