Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>events almost always bubble up unless event.cancelBubble=true is set or event.stopPropagation() is used. You are only aware of it, though, when one of your event handlers gets tripped.</p> <p>See <a href="http://en.wikipedia.org/wiki/DOM_events" rel="noreferrer">http://en.wikipedia.org/wiki/DOM_events</a> for a list of events which bubble. (Note: in the table of HTML events, cancelable refers to the effectiveness of event.preventDefault() or return false to cancel the default action, not bubbling)</p> <p>Also see <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow" rel="noreferrer">http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow</a>, in particular 1.2.1 Basic Flow to understand the capture phase and bubbling phase of event propagation.</p> <p><strong>EDIT</strong></p> <p><a href="http://mark-story.com/posts/view/speed-up-javascript-event-handling-with-event-delegation-and-bubbling" rel="noreferrer">http://mark-story.com/posts/view/speed-up-javascript-event-handling-with-event-delegation-and-bubbling</a> suggests there <em>is</em> a performance gain by stopping propagation but provides no data. </p> <p><a href="http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/a9af0aa4216a8046" rel="noreferrer">http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/a9af0aa4216a8046</a> suggests that browsers should be optimized for bubbling behaviour and says there should be no significant performance difference. Again no data.</p> <p><a href="http://developer.yahoo.com/performance/rules.html#events" rel="noreferrer">http://developer.yahoo.com/performance/rules.html#events</a> provides a good technique for improving event-handling performance, but doesn't directly talk about stopPropagation performance.</p> <p>Ultimately, you'd have to profile the difference to get a good idea of the benefits on your site.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload