Index: Source/core/rendering/RenderObject.cpp |
diff --git a/Source/core/rendering/RenderObject.cpp b/Source/core/rendering/RenderObject.cpp |
index 384f776cda75420089529927c3290474b9dd3e1d..dcc2d36b858f6c4ebf990679764538fbbf813a5a 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" |
@@ -2262,11 +2263,12 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle& newS |
// Since a CSS property cannot be applied directly to a text node, a |
// 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)) { |
+ if (document().frameHost() && node() && !node()->isTextNode() && (oldTouchAction == TouchActionAuto) != (newStyle.touchAction() == TouchActionAuto)) { |
abarth-chromium
2014/06/18 23:43:06
The document will always have a frameHost here.
Sami
2014/06/27 17:58:51
Done.
|
+ EventHandlerRegistry* registry = &document().frameHost()->eventHandlerRegistry(); |
Rick Byers
2014/06/19 17:10:36
nit - use ref instead of taking the address just t
Sami
2014/06/27 17:58:51
Done.
|
if (newStyle.touchAction() != TouchActionAuto) |
- document().didAddTouchEventHandler(node()); |
+ registry->didAddEventHandler(*node(), EventHandlerRegistry::TouchEvent); |
else |
- document().didRemoveTouchEventHandler(node()); |
+ registry->didRemoveEventHandler(*node(), EventHandlerRegistry::TouchEvent); |
} |
} |
@@ -2783,8 +2785,8 @@ void RenderObject::willBeDestroyed() |
// document is being destroyed as all handlers will have been cleared |
// 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()); |
+ if (!documentBeingDestroyed() && document().frameHost() && node() && !node()->isTextNode() && m_style && m_style->touchAction() != TouchActionAuto) |
abarth-chromium
2014/06/18 23:43:06
Same here
Sami
2014/06/27 17:58:51
Done.
|
+ document().frameHost()->eventHandlerRegistry().didRemoveEventHandler(*node(), EventHandlerRegistry::TouchEvent); |
setAncestorLineBoxDirty(false); |