- From: Philip Jägenstedt <notifications@github.com>
- Date: Tue, 12 Apr 2016 05:43:00 -0700
- To: whatwg/dom <dom@noreply.github.com>
- Message-ID: <whatwg/dom/issues/211/208885686@github.com>
I opened 10 of them "at random" and took a quick look. Mostly it's used as a fallback when `stopPropagation` doesn't exist, but those cases wouldn't show up in use counter data.
In https://maps.googleapis.com/maps/api/js and http://w.sharethis.com/share5x/js/stcommon.2b05accc08f1ee42fe1983647ab923ea.js and multiple other scripts it's used together with `stopPropagation` which would show up in use counters but removing it probably wouldn't be observable.
In http://www.speedup.ir/angular/app/scripts/vendor/jquery.nicescroll.js there are many uses, most similar to the above but one that's gated on `document.fireEvent`:
```JavaScript
else if (document.fireEvent) {
this.notifyScrollEvent = function(el) {
var e = document.createEventObject();
el.fireEvent("onscroll");
e.cancelBubble = true;
};
}
```
As long as Edge has removed `document.fireEvent`, that should be dead code everywhere.
In http://kolelnasmag.com/wp-content/themes/Fikra%20Mag3/js/uisearch.js there's an `addEventListener` polyfill which should also be dead code now.
In https://static.xx.fbcdn.net/rsrc.php/v2iaFb4/yH/l/en_US/0bcWBIJHikk.js @domenic makes an appearance :)
```JavaScript
/**
* @generated SignedSource<<4c94898b765e9ddb7bac02513e528723>>
*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* !! This file is a check-in of a static_upstream project! !!
* !! !!
* !! You should not modify this file directly. Instead: !!
* !! 1) Use `fjs use-upstream` to temporarily replace this with !!
* !! the latest version from upstream. !!
* !! 2) Make your changes, test them, etc. !!
* !! 3) Use `fjs push-upstream` to copy your changes back to !!
* !! static_upstream. !!
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* Copyright (c) 2012 Barnesandnoble.com, llc, Donavon West, and Domenic
* Denicola
```
Anyway, in that file there's a bit of code that I saw in a few places, seems like this is the unminified code:
https://github.com/davidxi/js-code-study/blob/9b990abbf038e0195567b30c8da216498c23691b/src/Event.js
It looks like this isn't actually an `Event` but a custom `EventObject` so it shouldn't be a problem.
That was a very quick check, but I didn't see anyone setting `cancelBubble` to false and it seems plausible that mapping `cancelBubble=true` to `stopPropagation()` is web compatible, at least worth investigating.
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/211#issuecomment-208885686
Received on Tuesday, 12 April 2016 12:43:30 UTC