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

Unified Diff: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp

Issue 2417783005: [Master/Overview CL] Make PageScaleFactor work for oopif subframe.
Patch Set: Rebase to master@{#429656}. Created 4 years, 1 month 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/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();
+ 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)));

Powered by Google App Engine
This is Rietveld 408576698