Index: Source/core/frame/LocalFrame.cpp |
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp |
index adfa8ad6ddaa9f1f29dc00c7fc6da1c1ea667bcf..e767e49410fc2ac0b586d13992aa3fe2cf84cf26 100644 |
--- a/Source/core/frame/LocalFrame.cpp |
+++ b/Source/core/frame/LocalFrame.cpp |
@@ -33,7 +33,7 @@ |
#include "RuntimeEnabledFeatures.h" |
#include "bindings/v8/ScriptController.h" |
#include "core/dom/DocumentType.h" |
-#include "core/dom/WheelController.h" |
+#include "core/dom/EventHandlerRegistry.h" |
#include "core/editing/Editor.h" |
#include "core/editing/FrameSelection.h" |
#include "core/editing/InputMethodController.h" |
@@ -466,12 +466,13 @@ void LocalFrame::notifyChromeClientWheelEventHandlerCountChanged() const |
// Ensure that this method is being called on the main frame of the page. |
ASSERT(isMainFrame()); |
- unsigned count = 0; |
- for (const LocalFrame* frame = this; frame; frame = frame->tree().traverseNext()) { |
- if (frame->document()) |
- count += WheelController::from(*frame->document())->wheelEventHandlerCount(); |
+ EventHandlerRegistry* registry = EventHandlerRegistry::from(*document()); |
+ unsigned count = registry->externalEventHandlerCount(EventHandlerRegistry::WheelEvent); |
+ const EventTargetSet* targets = registry->eventHandlerTargets(EventHandlerRegistry::WheelEvent); |
+ if (targets) { |
+ for (EventTargetSet::const_iterator iter = targets->begin(); iter != targets->end(); ++iter) |
+ count += iter->value; |
} |
- |
m_host->chrome().client().numWheelEventHandlersChanged(count); |
} |