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

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: Fixed HTMLInputElement adding handler at document destruction and removed dead oilpan code. Created 6 years, 6 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/rendering/RenderObject.cpp
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp
index e3194e45b26745dd218c97f50ab36e264aaa7441..280cc2553948c66e68be6e404c2ba67e03d9a201 100644
--- a/Source/core/rendering/RenderObject.cpp
+++ b/Source/core/rendering/RenderObject.cpp
@@ -37,6 +37,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"
@@ -2153,10 +2154,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);
}
}
@@ -2674,7 +2676,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);

Powered by Google App Engine
This is Rietveld 408576698