GoogleChrome / GoogleChrome/lighthouse
Cannot trigger "Does not use passive listeners to improve scrolling performance" violation
- Dominant language
- JavaScript
- Stars
- 30.8k
- Forks
- 9.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 20
Description
#### Provide the steps to reproduce
1. Run LH on https://1p98o.csb.app/
```js
// make the body scrollable
document.body.style.setProperty(
'height',
'150vh',
);
// this *should* cause a violation
window.addEventListener(
'wheel',
function onWheel(event) {
console.log('not passive');
},
{
passive: false,
},
);
// this is fine and does not cause a violation
window.addEventListener(
'wheel',
function onWheel(event) {
console.log('passive');
},
{
passive: true,
},
);
```
#### What is the current behavior?
Adding a non-passive `wheel` (or `mousewheel`), `touchstart` or `touchmove` event listener to the `window`, `document` or `body` is *not* triggering a ["Does not use passive listeners to improve scrolling performance"](https://web.dev/uses-passive-event-listeners/) violation
#### What is the expected behavior?
It would trigger a violation
#### Environment Information
* Affected Channels: DevTools (have not tested other channels)
* Lighthouse version: `7.0.0` and `7.2.0`
* Chrome version: `89.0.4389.82` and `91.0.4440.0`
Cheers
Contributor guide
Assessment
This issue has not been assessed yet.