- From: Joćo Eiras <joao.eiras@gmail.com>
- Date: Thu, 28 Dec 2006 00:12:31 -0000
- To: "Hallvord R. M. Steen" <hallvord@opera.com>
- Cc: "www-dom@w3.org" <www-dom@w3.org>
I too have 3 questions: - is the window considered as a target in the entire event capturing and bubbling phases ? * in Gecko yes, in Opera no. - should events registered to the window have the document as target ? * both in Gecko and Opera yes. - should capturing of load events be supported too when registering a capturing event listener in the window ? * in Opera yes, in Gecko no as consequence of their 'fix' The ecmascript binding needs clarification in this regard. Hallvord R. M. Steen <hallvord@opera.com> escreveu: > Hi, > I have a request for clarification regarding the behaviour of capturing > events. > > Opera has implemented capture of load events in the document, meaning > that an event listener added with > > window.addEventListener('load', func, true); > > would run for every load event on IMG, SCRIPT, LINK rel="stylesheet" > etc. in the document. > > This is also implemented in Safari but not supported in Mozilla until > recently (see bug 331306 - [1]) > > While we think Opera's/Safari's implementation is correct according to > the spec, a number of sites out there rely on Mozilla's bug and expect > such an event listener to run only once. > > Mozilla developers have proposed a solution in bug 335251 [2]. They > suggest that load events should not propagate to the "window" object in > the browser's JavaScript environment. > > Pros of Mozilla's suggestion: > - it's backwards compatible with existing content > > Cons: > - we introduce an inconsistency to the whole event listener model that > means for example these two will mean very different things.. > > window.addEventListener('click', func, true); // runs for any click event > window.addEventListener('load', func, true); // runs once only > > > It is not clear from the DOM Events spec how the "window" object fits > into the capturing/bubbling. Could this be clarified? Which behaviour > should be considered correct per the spec? > > [1] https://bugzilla.mozilla.org/show_bug.cgi?id=331306 > > [2] https://bugzilla.mozilla.org/show_bug.cgi?id=335251 > > Commentary: > http://my.opera.com/hallvors/blog/2006/12/23/firechicken >
Received on Thursday, 28 December 2006 00:12:32 UTC