Re: ISSUE-44 (EventsAndWindow): Should DOM3 Events cover the interaction of events and the Window object? [DOM3 Events]

Jonas Sicking wrote:
> 
> Ian Hickson wrote:
>> On Thu, 7 Aug 2008, Olli Pettay wrote:
>>> Could we actually just say that if document implements DocumentView 
>>> interface and .defaultView isn't null and implements EventTarget, the 
>>> event propagates to .defaultView. So in that case defaultView becomes 
>>> the root of the event target chain (if the target of the event is 
>>> bound to document). No need to mention Window, since AbstractView is 
>>> already defined in DOM2 Views[1]. HTML5 defines that AbstractView 
>>> must also implement Window and EventTarget interfaces. [2]
>>
>> Fine by me, so long as the result is compatible with most UAs.
> 
> One very unfortunate thing is that if i recall correctly the Window 
> object never takes part in the EventTarget chain for the 'load' event. 
> But does for all other events. This was because a lot of sites broke 
> when we tried to bubble 'load' to the Window.
> 
> / Jonas
> 

Sure, load events are special case, like mentioned in 
http://www.whatwg.org/specs/web-apps/current-work/#events0.
Because of web compatibility the load event which is dispatched when a
page is loaded has also other quirks, at least in gecko; it is
dispatched to window, but its target is document.

But in usual case events should propagate to .defaultView

-Olli

Received on Friday, 8 August 2008 07:13:05 UTC