Skip to content

Commit

Permalink
remove testPassive after testing, fix maptalks/issues#793
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzhenn committed Nov 21, 2024
1 parent ff2cd3c commit f514256
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/Browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ function getDevicePixelRatio() {
return (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI));
}

function isPassive() {
}

if (!IS_NODE) {
const ua = navigator.userAgent.toLowerCase(),
doc = document.documentElement || { style: {} },
Expand Down Expand Up @@ -119,13 +122,14 @@ if (!IS_NODE) {
/* Add feature test for passive event listener support */
let supportsPassive = false;
try {
window.addEventListener('testPassive', () => {
}, {

window.addEventListener('testPassive', isPassive, {
get passive() {
supportsPassive = true;
return true;
}
});
window.removeEventListener('testPassive', isPassive);
/*eslint-disable no-empty */
} catch (e) {
}
Expand Down

0 comments on commit f514256

Please sign in to comment.