Bubbling Event
JavaScript fully validates the document. If you add a listener to the document and a listener on the inside, both listeners light up.
Event Recording
JavaScript starts with a document and goes to the inside. If you add a listener to the document and a listener on the inside, both listeners shoot.
My findings
Turns out the browser does some smart processing so that it
a) no need to iterate over the entire hierarchical parent element
and
b) no need to go through all the events.
Evidence
a) The browser does not take time to trigger both click events when the inner div is pressed:
Fiddle
b) The browser does not have enough time to trigger both click events when the internal div is pressed, when there are many other events that are associated with other DOM elements, and not with the parent hierarchy:
Fiddle
source share