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

Unified Diff: Source/core/dom/Node.cpp

Issue 225903009: Migrate touch events to EventHandlerRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix indendation problems (added by meld?) Created 6 years, 4 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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/EventHandlerRegistry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index cd07aa30ef859ee7d59b7dbc96a1a43bc501a7fb..537bf2ee8888bbbae8d9a294206e79fcfbea6ff5 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -327,10 +327,8 @@ void Node::willBeDeletedFromDocument()
Document& document = this->document();
- if (hasEventTargetData()) {
+ if (hasEventTargetData())
clearEventTargetData();
- document.didClearTouchEventHandlers(this);
- }
if (document.frameHost())
document.frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
@@ -1857,19 +1855,12 @@ void Node::didMoveToNewDocument(Document& oldDocument)
oldDocument.markers().removeMarkers(this);
oldDocument.updateRangesAfterNodeMovedToAnotherDocument(*this);
-
- if (const TouchEventTargetSet* touchHandlers = oldDocument.touchEventTargets()) {
- while (touchHandlers->contains(this)) {
- oldDocument.didRemoveTouchEventHandler(this);
- document().didAddTouchEventHandler(this);
- }
- }
- if (oldDocument.frameHost() != document().frameHost()) {
- if (oldDocument.frameHost())
- oldDocument.frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost(*this);
- if (document().frameHost())
- document().frameHost()->eventHandlerRegistry().didMoveIntoFrameHost(*this);
- }
+ if (oldDocument.frameHost() && !document().frameHost())
+ oldDocument.frameHost()->eventHandlerRegistry().didMoveOutOfFrameHost(*this);
+ else if (document().frameHost() && !oldDocument.frameHost())
+ document().frameHost()->eventHandlerRegistry().didMoveIntoFrameHost(*this);
+ else if (oldDocument.frameHost() != document().frameHost())
+ EventHandlerRegistry::didMoveBetweenFrameHosts(*this, oldDocument.frameHost(), document().frameHost());
if (WillBeHeapVector<OwnPtrWillBeMember<MutationObserverRegistration> >* registry = mutationObserverRegistry()) {
for (size_t i = 0; i < registry->size(); ++i) {
@@ -1891,8 +1882,6 @@ static inline bool tryAddEventListener(Node* targetNode, const AtomicString& eve
Document& document = targetNode->document();
document.addListenerTypeIfNeeded(eventType);
- if (isTouchEventType(eventType))
- document.didAddTouchEventHandler(targetNode);
if (document.frameHost())
document.frameHost()->eventHandlerRegistry().didAddEventHandler(*targetNode, eventType);
@@ -1912,8 +1901,6 @@ static inline bool tryRemoveEventListener(Node* targetNode, const AtomicString&
// FIXME: Notify Document that the listener has vanished. We need to keep track of a number of
// listeners for each type, not just a bool - see https://bugs.webkit.org/show_bug.cgi?id=33861
Document& document = targetNode->document();
- if (isTouchEventType(eventType))
- document.didRemoveTouchEventHandler(targetNode);
if (document.frameHost())
document.frameHost()->eventHandlerRegistry().didRemoveEventHandler(*targetNode, eventType);
@@ -1930,7 +1917,6 @@ void Node::removeAllEventListeners()
if (hasEventListeners() && document().frameHost())
document().frameHost()->eventHandlerRegistry().didRemoveAllEventHandlers(*this);
EventTarget::removeAllEventListeners();
- document().didClearTouchEventHandlers(this);
}
void Node::removeAllEventListenersRecursively()
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/EventHandlerRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698