Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(805)

Unified Diff: chrome/browser/resources/pdf/gesture_detector.js

Issue 2612773006: PDF viewer: Specify that the touchstart listener not be passive. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/pdf/gesture_detector_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/pdf/gesture_detector.js
diff --git a/chrome/browser/resources/pdf/gesture_detector.js b/chrome/browser/resources/pdf/gesture_detector.js
index a64729e58adbc116946f24b7f8069848b459217c..fde4650d92bbbc6db1d8ed7aa7259c90a9e144c3 100644
--- a/chrome/browser/resources/pdf/gesture_detector.js
+++ b/chrome/browser/resources/pdf/gesture_detector.js
@@ -16,10 +16,14 @@ class GestureDetector {
constructor(element) {
this.element_ = element;
- this.element_.addEventListener('touchstart', this.onTouchStart_.bind(this));
- this.element_.addEventListener('touchmove', this.onTouch_.bind(this));
- this.element_.addEventListener('touchend', this.onTouch_.bind(this));
- this.element_.addEventListener('touchcancel', this.onTouch_.bind(this));
+ this.element_.addEventListener(
+ 'touchstart', this.onTouchStart_.bind(this), { passive: false });
+ this.element_.addEventListener(
+ 'touchmove', this.onTouch_.bind(this), { passive: true });
+ this.element_.addEventListener(
+ 'touchend', this.onTouch_.bind(this), { passive: true });
+ this.element_.addEventListener(
+ 'touchcancel', this.onTouch_.bind(this), { passive: true });
this.pinchStartEvent_ = null;
this.lastEvent_ = null;
« no previous file with comments | « no previous file | chrome/test/data/pdf/gesture_detector_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698