Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp |
| diff --git a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp |
| index f30bf1cc3d93cc278d730bbbcc82956933a72687..8695bc1ae3da699bebe44e66fd440b7f4ed63613 100644 |
| --- a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp |
| +++ b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp |
| @@ -119,8 +119,12 @@ void EventHandlerRegistry::updateEventHandlerInternal( |
| bool targetSetChanged = updateEventHandlerTargets(op, handlerClass, target); |
| bool hasHandlers = m_targets[handlerClass].size(); |
| - if (hadHandlers != hasHandlers) |
| - notifyHasHandlersChanged(handlerClass, hasHandlers); |
| + if (hadHandlers != hasHandlers) { |
| + LocalFrame* frame = nullptr; |
| + if (Node* node = target->toNode()) |
| + frame = node->document().frame(); |
|
dcheng
2016/11/04 21:00:02
Do we not care if the EventTarget is a non-node ty
wjmaclean
2016/11/07 15:57:27
I don't think so. In the past this has always been
dcheng
2016/11/08 18:11:00
I did some research, and this is used for LocalDOM
wjmaclean
2016/11/09 18:09:38
I suppose we could always fall back to the main fr
|
| + notifyHasHandlersChanged(frame, handlerClass, hasHandlers); |
| + } |
| if (targetSetChanged) |
| notifyDidAddOrRemoveEventHandlerTarget(handlerClass); |
| @@ -210,6 +214,7 @@ void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) { |
| } |
| void EventHandlerRegistry::notifyHasHandlersChanged( |
| + LocalFrame* frame, |
| EventHandlerClass handlerClass, |
| bool hasActiveHandlers) { |
| switch (handlerClass) { |
| @@ -219,14 +224,14 @@ void EventHandlerRegistry::notifyHasHandlersChanged( |
| case WheelEventBlocking: |
| case WheelEventPassive: |
| m_frameHost->chromeClient().setEventListenerProperties( |
| - WebEventListenerClass::MouseWheel, |
| + frame, WebEventListenerClass::MouseWheel, |
| webEventListenerProperties(hasEventHandlers(WheelEventBlocking), |
| hasEventHandlers(WheelEventPassive))); |
| break; |
| case TouchStartOrMoveEventBlocking: |
| case TouchStartOrMoveEventPassive: |
| m_frameHost->chromeClient().setEventListenerProperties( |
| - WebEventListenerClass::TouchStartOrMove, |
| + frame, WebEventListenerClass::TouchStartOrMove, |
| webEventListenerProperties( |
| hasEventHandlers(TouchStartOrMoveEventBlocking), |
| hasEventHandlers(TouchStartOrMoveEventPassive))); |
| @@ -234,7 +239,7 @@ void EventHandlerRegistry::notifyHasHandlersChanged( |
| case TouchEndOrCancelEventBlocking: |
| case TouchEndOrCancelEventPassive: |
| m_frameHost->chromeClient().setEventListenerProperties( |
| - WebEventListenerClass::TouchEndOrCancel, |
| + frame, WebEventListenerClass::TouchEndOrCancel, |
| webEventListenerProperties( |
| hasEventHandlers(TouchEndOrCancelEventBlocking), |
| hasEventHandlers(TouchEndOrCancelEventPassive))); |