Don't warn for passive: false pages |
|||||
Issue description
Right now we get the warning every time:
[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive.
Would it be possible to hide the warning if the passive is explicitly set to false? We have a library[1] where preventDefault is needed and with many invocations of this library, the entire console is flooded with warnings.
# Show warning
el.addEventListener('touchstart', function() {})
# No warning (desired change; currently this will also show a warning)
el.addEventListener('touchstart', function() {}, { passive: false })
[1] https://github.com/Leaflet/Leaflet/issues/5004
,
Sep 29 2017
,
Sep 29 2017
Already filed, it turns out. :-) https://github.com/GoogleChrome/lighthouse/issues/3137
,
Oct 3 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/25dc0992a465742bf3a508d2f099e51fd56b1e15 commit 25dc0992a465742bf3a508d2f099e51fd56b1e15 Author: Dave Tapuska <dtapuska@chromium.org> Date: Tue Oct 03 19:51:08 2017 Don't warn for passive: false pages Explicitly avoid messages to use passive event listeners for targets that add event listeners via EventListenerOptions with passive: false. BUG= 770208 Change-Id: I1e4173c3c8f28fa234ca112c0fe07f81aab549ab Reviewed-on: https://chromium-review.googlesource.com/695722 Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org> Commit-Queue: Dave Tapuska <dtapuska@chromium.org> Cr-Commit-Position: refs/heads/master@{#506148} [modify] https://crrev.com/25dc0992a465742bf3a508d2f099e51fd56b1e15/third_party/WebKit/Source/core/dom/events/EventTarget.cpp
,
Oct 3 2017
,
Oct 3 2017
What version of Chrome will the fix appear in?
,
Oct 3 2017
63
,
Oct 3 2017
,
Oct 3 2017
Awesome. Thanks!
,
Oct 11 2017
Issue 754645 has been merged into this issue. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by joeyparrish@chromium.org
, Sep 29 2017