W3C home > Mailing lists > Public > public-webapi@w3.org > March 2006

Example of breakage from capturing listeners not firing on target:

From: Maciej Stachowiak <mjs@apple.com>
Date: Wed, 29 Mar 2006 16:17:51 -0800
Message-Id: <B2B9FE48-1232-4F79-8898-F603D9AE0FCF@apple.com>
To: Web APIs WG <public-webapi@w3.org>


In Safari we have changed since the last shipping version to no  
longer fire useCapture = true event listeners on the target.

One site that breaks is MapQuest:

http://bugzilla.opendarwin.org/show_bug.cgi?id=7205

I am sure others will be broken.

Almost all the breakage seems to stem from an addEvent function  
that's floating around. It uses attachEvent in IE but  
addEventListener with useCapture = true on DOM Events browsers, which  
seems very wrong. In this particular instance, there is an Opera  
workaround, but I think the Opera code path would actually also work  
in Safari and Mozilla.

Should we start tracking down the source of this script and sites  
that use it, or back down and change the DOM events spec so that  
capturing listeners fire on the target?

I actually think the latter behavior is better since we've seen (in  
the focus event discussion) numerous complaints that using capture  
usually requires registering two listeners, and we've seen no obvious  
use cases where not firing on the target was helpful.

Regards,
Maciej
Received on Thursday, 30 March 2006 00:18:00 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:54 GMT