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

Unified Diff: Source/core/rendering/RenderObject.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/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index 3aa1d848532a88e0c7260c55a3840295caf0985d..e7c9966563bc4978977e78e12c01ec0dcab87e21 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -38,6 +38,7 @@
#include "core/editing/htmlediting.h"
#include "core/fetch/ResourceLoadPriorityOptimizer.h"
#include "core/fetch/ResourceLoader.h"
+#include "core/frame/EventHandlerRegistry.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
#include "core/html/HTMLAnchorElement.h"
@@ -2184,10 +2185,11 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS
// handler will have already been added for its parent so ignore it.
TouchAction oldTouchAction = m_style ? m_style->touchAction() : TouchActionAuto;
if (node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) != (newStyle.touchAction() == TouchActionAuto)) {
+ EventHandlerRegistry& registry = document().frameHost()->eventHandlerRegistry();
if (newStyle.touchAction() != TouchActionAuto)
- document().didAddTouchEventHandler(node());
+ registry.didAddEventHandler(*node(), EventHandlerRegistry::TouchEvent);
else
- document().didRemoveTouchEventHandler(node());
+ registry.didRemoveEventHandler(*node(), EventHandlerRegistry::TouchEvent);
}
}
@@ -2705,7 +2707,7 @@ void RenderObject::willBeDestroyed()
// previously. Handlers are not added for text nodes so don't try removing
// for one too. Need to check if m_style is null in cases of partial construction.
if (!documentBeingDestroyed() && node() && !node()->isTextNode() && m_style && m_style->touchAction() != TouchActionAuto)
- document().didRemoveTouchEventHandler(node());
+ document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*node(), EventHandlerRegistry::TouchEvent);
setAncestorLineBoxDirty(false);
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698