| Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp
|
| diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
|
| index 5fa4ebd155681c1366870b4e749c3a9fcfc4cce4..2a2c776babdd4e1848a40cdbf7cb69305496cff6 100644
|
| --- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
|
| +++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
|
| @@ -8,6 +8,7 @@
|
| #include "core/dom/UserGestureIndicator.h"
|
| #include "core/dom/shadow/FlatTreeTraversal.h"
|
| #include "core/events/MouseEvent.h"
|
| +#include "core/frame/EventHandlerRegistry.h"
|
| #include "core/frame/LocalFrameView.h"
|
| #include "core/frame/UseCounter.h"
|
| #include "core/html/HTMLCanvasElement.h"
|
| @@ -28,6 +29,9 @@ namespace {
|
| size_t ToPointerTypeIndex(WebPointerProperties::PointerType t) {
|
| return static_cast<size_t>(t);
|
| }
|
| +bool HasPointerEventListener(const EventHandlerRegistry& registry) {
|
| + return registry.HasEventHandlers(EventHandlerRegistry::kPointerEvent);
|
| +}
|
|
|
| Vector<std::pair<WebTouchPoint, TimeTicks>> GetCoalescedPoints(
|
| const Vector<WebTouchEvent>& coalesced_events,
|
| @@ -159,8 +163,11 @@ WebInputEventResult PointerEventManager::DispatchPointerEvent(
|
| }
|
| }
|
|
|
| - if (!RuntimeEnabledFeatures::PointerEventEnabled())
|
| + if (!frame_ || !frame_->GetPage() ||
|
| + !HasPointerEventListener(frame_->GetPage()->GetEventHandlerRegistry()) ||
|
| + !RuntimeEnabledFeatures::PointerEventEnabled())
|
| return WebInputEventResult::kNotHandled;
|
| +
|
| if (!check_for_listener || target->HasEventListeners(event_type)) {
|
| UseCounter::Count(frame_, UseCounter::kPointerEventDispatch);
|
| if (event_type == EventTypeNames::pointerdown)
|
|
|