This panel acts as a sink for all DOM events in its subtree, with a single top-level DOM event listener. Application-level event handlers register themselves with this panel against elements of a particular "kind". When a browser-event occurs, this panel traces up the DOM hierarchy from the source of the event, locating the nearest ancestor with a kind for which an event handler is registered, and dispatches the event to that handler. Dispatching continues up the DOM tree to all such element/handler pairs, until this panel's element is reached, or until a handler declares that propagation should stop. This process is analogous to the native browser mechanism of event bubbling.
This dispatch mechanism has some specific advantages and disadvantages.
Advantages:
|
|
|
|