- From: Jonas Sicking <jonas@sicking.cc>
- Date: Wed, 10 Feb 2010 11:56:49 -0800
On Wed, Feb 10, 2010 at 11:29 AM, Boris Zbarsky <bzbarsky at mit.edu> wrote: > On 2/10/10 2:19 PM, Brian Campbell wrote: >> >> Do browsers fire events for which there are no listeners? > > It varies. ?Gecko, for example, fires image load events not matter what but > only fires mutation events if there are listeners. However checking for listeners has a non-trivial cost. You have to walk the full parentNode chain and see if any of the parents has a listener. This applies to both bubbling and non-bubbling events due to the capture phase. Also, feature which requires implementations to optimize for the feature not being used seems like a questionable feature to me. We want people to use the stuff we're creating, there's little point otherwise. / Jonas
Received on Wednesday, 10 February 2010 11:56:49 UTC