angular/angular.js — pull request #4833 by mbenford (2013-11-08 04:14:30+00:00)
Title: fix(jqLite): fix event.stopImmediatePropagation() so it works as expected

jqLite doesn't override the default implementation of `event.stopImmediatePropagation` and so it doesn't work as expected, i.e, it doesn't prevent the rest of the event handlers from being executed. I've fixed that for events handled with `on` and triggered by `triggerHandler`.

For the sake of consistency with jQuery, I've also added an `isImmediatePropagationStopped` function to the event object so one can tell whether the immediate propagation was stopped or not.

Lastly, this implementation won't immediate stop propagation to event handlers created with `element.addEventListener`. I could have easily solved that by making `stopImmediatePropagation` call its native counterpart, but that would render it incompatible with jQuery's implementation. In order to comply with jQuery, I would have to add an `originalEvent` property to the event object so one could call `originalEvent.stopImmediatePropagation()`, but I've found it hard to correctly implement without making the code overly complex.