Merge pull request #15504 from Snuffleupagus/rm-stopImmediatePropagation-checks

Use `stopImmediatePropagation` without checking for its existence first
This commit is contained in:
Tim van der Meij 2022-09-24 15:15:04 +02:00 committed by GitHub
commit 5f65df774f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -314,14 +314,8 @@ window.addEventListener(
) {
window.print();
// The (browser) print dialog cannot be prevented from being shown in
// IE11.
event.preventDefault();
if (event.stopImmediatePropagation) {
event.stopImmediatePropagation();
} else {
event.stopPropagation();
}
event.stopImmediatePropagation();
}
},
true
@ -331,7 +325,7 @@ if ("onbeforeprint" in window) {
// Do not propagate before/afterprint events when they are not triggered
// from within this polyfill. (FF / Chrome 63+).
const stopPropagationIfNeeded = function (event) {
if (event.detail !== "custom" && event.stopImmediatePropagation) {
if (event.detail !== "custom") {
event.stopImmediatePropagation();
}
};