Bug 18771 - postMessage should dispatch an event to Window, not Document
Summary: postMessage should dispatch an event to Window, not Document
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://lists.whatwg.org/pipermail/wha...
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-27 07:30 PDT by Adam Roben (:aroben)
Modified: 2008-05-09 14:02 PDT (History)
4 users (show)

See Also:


Attachments
Work in progress (16.12 KB, patch)
2008-05-07 02:19 PDT, Adam Barth
no flags Details | Formatted Diff | Diff
Patch (16.97 KB, patch)
2008-05-07 23:38 PDT, Collin Jackson
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2008-04-27 07:30:03 PDT
HTML 5's postMessage was just changed to dispatch its event to Window instead of Document. <http://html5.org/tools/web-apps-tracker?from=1490&to=1491> contains the actual change to the spec. We should update our implementation to match the spec.
Comment 1 Adam Barth 2008-04-27 10:03:32 PDT
This can probably happen either before or after Bug 18725, but the patches are likely to touch some of the same lines of code.
Comment 2 Adam Barth 2008-05-07 02:19:19 PDT
Created attachment 20997 [details]
Work in progress

Here is a work-in-progress patch.  I really need to get a Mac so I can run the LayoutTests.
Comment 3 Collin Jackson 2008-05-07 23:38:10 PDT
Created attachment 21010 [details]
Patch

I ran the tests and they pass. I added a comment to cross-domain-message-event-dispatch.html explaining why postMessage events are faster than setTimeout handlers.
Comment 4 Sam Weinig 2008-05-08 08:54:45 PDT
Comment on attachment 21010 [details]
Patch

I realize this is just being moved, but the & is in the wrong place.
+void EventTargetNode::dispatchWindowEvent(const AtomicString &eventType, bool canBubbleArg, bool cancelableArg)


r=me.  (Anders gave his approval too!)
Comment 5 Sam Weinig 2008-05-09 13:17:45 PDT
Fix landed in r33006?  Does this mean we are up to date with the postMessage spec?
Comment 6 Adam Roben (:aroben) 2008-05-09 14:02:55 PDT
(In reply to comment #5)
> Fix landed in r33006?

Can you not remember? Here's a hint: <http://trac.webkit.org/changeset/33006>