New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 770208 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Don't warn for passive: false pages

Project Member Reported by dtapu...@chromium.org, Sep 29 2017

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
 
I'm having the same issue in Shaka Player.  I have to have one explicitly non-passive listener.

Lighthouse seems to complain about explicit passive: false as well.  I'll file a bug against Lighthouse separately.
Cc: joeyparrish@chromium.org
Already filed, it turns out.  :-)

https://github.com/GoogleChrome/lighthouse/issues/3137
Project Member

Comment 4 by bugdroid1@chromium.org, 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

Status: Fixed (was: Assigned)
What version of Chrome will the fix appear in?
63
Labels: M-63
Awesome.  Thanks!

Comment 10 by l...@chromium.org, Oct 11 2017

Cc: l...@chromium.org skobes@chromium.org pfeldman@chromium.org dtapu...@chromium.org
 Issue 754645  has been merged into this issue.

Sign in to add a comment