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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2127163002: Limit PassiveDocumentEventListeners to touch and make it experimental (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A few more layout tests Created 4 years, 5 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
Index: third_party/WebKit/Source/core/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 92bd274edfce15a084ab1bacf2935052978e3aef..420267bb03f72e81ae55cb96d7fb38c801ec171d 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -67,6 +67,12 @@ Settings* windowSettings(LocalDOMWindow* executingWindow)
return nullptr;
}
+bool isTouchScrollBlockingEvent(const AtomicString& eventType)
+{
+ return eventType == EventTypeNames::touchstart
+ || eventType == EventTypeNames::touchmove;
+}
+
bool isScrollBlockingEvent(const AtomicString& eventType)
{
return eventType == EventTypeNames::touchstart
Rick Byers 2016/07/07 20:02:09 nit: replace these two lines with isTouchScrollBlo
dtapuska 2016/07/07 20:34:22 Done.
@@ -199,7 +205,7 @@ void EventTarget::setDefaultAddEventListenerOptions(const AtomicString& eventTyp
}
}
- if (RuntimeEnabledFeatures::passiveDocumentEventListenersEnabled()) {
+ if (RuntimeEnabledFeatures::passiveDocumentEventListenersEnabled() && isTouchScrollBlockingEvent(eventType)) {
if (!options.hasPassive()) {
if (Node* node = toNode()) {
if (node->isDocumentNode() || node->document().documentElement() == node || node->document().body() == node) {

Powered by Google App Engine
This is Rietveld 408576698