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

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: Rebase 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 5867b955d756ae1704e41cd985b86a9a6f108cdf..c9316bd79dfeb0e6a96a8137725369cb1e8aac53 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -67,10 +67,15 @@ Settings* windowSettings(LocalDOMWindow* executingWindow)
return nullptr;
}
-bool isScrollBlockingEvent(const AtomicString& eventType)
+bool isTouchScrollBlockingEvent(const AtomicString& eventType)
{
return eventType == EventTypeNames::touchstart
- || eventType == EventTypeNames::touchmove
+ || eventType == EventTypeNames::touchmove;
+}
+
+bool isScrollBlockingEvent(const AtomicString& eventType)
+{
+ return isTouchScrollBlockingEvent(eventType)
|| eventType == EventTypeNames::mousewheel
|| eventType == EventTypeNames::wheel;
}
@@ -199,7 +204,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