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

Unified Diff: Source/core/frame/LocalFrame.cpp

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase harder. Created 6 years, 8 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: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index baf32f31d7ca627fb74b123c8503df22bc52ac09..87143015cbea391d31fcb38a68fed3c57dd242dc 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"
@@ -469,12 +469,13 @@ void LocalFrame::notifyChromeClientWheelEventHandlerCountChanged() const
// Ensure that this method is being called on the main frame of the page.
ASSERT(isMainFrame());
Ian Vollick 2014/04/08 15:40:51 Is this another call into the "black hole"? If so,
Sami 2014/04/08 16:25:00 Indeed it is. Done.
- 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);
}

Powered by Google App Engine
This is Rietveld 408576698