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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1577263004: Communicate whether passive event listeners exist to cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_wheel_passive_listeners
Patch Set: Fix nits Created 4 years, 10 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/input/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 5ec337e655cfa8a1cfe03b4df1cb535a050dfb01..4939887c51ad89f460030c672903bd81b1365a37 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -104,6 +104,12 @@ namespace blink {
namespace {
+bool hasTouchHandlers(const EventHandlerRegistry& registry)
+{
+ return registry.hasEventHandlers(EventHandlerRegistry::TouchEventBlocking)
+ || registry.hasEventHandlers(EventHandlerRegistry::TouchEventPassive);
+}
+
WebInputEventResult mergeEventResult(WebInputEventResult responseA, WebInputEventResult responseB)
{
// The ordering of the enumeration is specific. There are times that
@@ -4002,7 +4008,7 @@ WebInputEventResult EventHandler::handleTouchEvent(const PlatformTouchEvent& eve
// If there's no document receiving touch events, or no handlers on the
// document set to receive the events, then we can skip all the rest of
// this work.
- if (!m_touchSequenceDocument || !m_touchSequenceDocument->frameHost() || !m_touchSequenceDocument->frameHost()->eventHandlerRegistry().hasEventHandlers(EventHandlerRegistry::TouchEvent) || !m_touchSequenceDocument->frame()) {
+ if (!m_touchSequenceDocument || !m_touchSequenceDocument->frameHost() || !hasTouchHandlers(m_touchSequenceDocument->frameHost()->eventHandlerRegistry()) || !m_touchSequenceDocument->frame()) {
if (allTouchReleased) {
m_touchSequenceDocument.clear();
m_touchSequenceUserGestureToken.clear();

Powered by Google App Engine
This is Rietveld 408576698