W3C home > Mailing lists > Public > public-html@w3.org > April 2008

Re: [whatwg] postMessage feedback

From: Maciej Stachowiak <mjs@apple.com>
Date: Sat, 26 Apr 2008 16:26:43 -0700
Cc: "whatwg@whatwg.org" <whatwg@whatwg.org>, Ian Hickson <ian@hixie.ch>, HTML WG <public-html@w3.org>
Message-Id: <3136DBBA-5B68-434D-9E3A-7D17713D59EC@apple.com>
To: jwalden+whatwg@MIT.EDU


On Apr 26, 2008, at 3:07 PM, Jeff Walden wrote:

> Maciej Stachowiak wrote:
>> If anything this event should dispatch to the window, not the  
>> document, since that is what gets the postMessage call. But posting  
>> to the document and bubbling to the window seems ok too.
>
> The event currently doesn't bubble to accommodate <event-source>:
>
> http://lists.whatwg.org/htdig.cgi/commit-watchers-whatwg.org/2008/000436.html
>
> So right now, either you use a bubbling listener (capturing works  
> too, although the web may end up dictating that that's a bug that  
> won't be fixt) on the document or a capturing listener (ugh) on  
> window or you don't get it.  I'm not entirely sure why the event  
> doesn't bubble for postMessage; it seems like a postMessage event  
> doesn't necessarily have to do the same thing as an <event-source>  
> event, but maybe there's precedent here that I don't know.
>
> As far as I can tell the event is dispatched at the document only  
> because Opera's original implementation had postMessage on  
> document.  I sort of prefer dispatching to the window as well, but  
> that change would have to be made ASAP to make Firefox 3.  It's a  
> one-line change (+30ish for addEventListener calls in tests, also  
> easy to do), as is the bubbling change, but it's extraordinarily  
> late for us to make these changes (async cuts it very, very fine as- 
> is), and nobody would be happy if the spec converged on something  
> that Firefox 3 didn't actually implement.

I hope this can be addressed soon, and I feel your pain. But in Safari  
3.1 we actually dropped postMessage at the last minute because of too  
many spec changes, and the spec changed in major ways after Opera  
actually shipped their implementation, so it's not like changes here  
are unprecedented and certainly Firefox is not being singled out.

(On the substance, I think dispatching to the window would be better  
based on your comments.)

Cheers,
Maciej
Received on Saturday, 26 April 2008 23:27:23 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:54 UTC