Bug 18771

Summary: postMessage should dispatch an event to Window, not Document
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, collinj, jwalden+bwo, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-April/014570.html
Attachments:
Description Flags
Work in progress
none
Patch sam: review+

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>