summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/page/EventHandler.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/page/EventHandler.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
index 0a0e8c6..46dd7ae 100644
--- a/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
+++ b/src/3rdparty/webkit/WebCore/page/EventHandler.cpp
@@ -230,6 +230,9 @@ void EventHandler::clear()
m_capturingMouseEventsNode = 0;
m_latchedWheelEventNode = 0;
m_previousWheelScrolledNode = 0;
+#if ENABLE(TOUCH_EVENTS)
+ m_originatingTouchPointTargets.clear();
+#endif
}
void EventHandler::selectClosestWordFromMouseEvent(const MouseEventWithHitTestResults& result)
@@ -2714,21 +2717,21 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// Increment the platform touch id by 1 to avoid storing a key of 0 in the hashmap.
unsigned touchPointTargetKey = point.id() + 1;
- EventTarget* touchTarget = 0;
+ RefPtr<EventTarget> touchTarget;
if (point.state() == PlatformTouchPoint::TouchPressed) {
m_originatingTouchPointTargets.set(touchPointTargetKey, target);
touchTarget = target;
} else if (point.state() == PlatformTouchPoint::TouchReleased || point.state() == PlatformTouchPoint::TouchCancelled) {
// The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
// we also remove it from the map.
- touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey).get();
+ touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
} else
- touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey).get();
+ touchTarget = m_originatingTouchPointTargets.get(touchPointTargetKey);
- if (!touchTarget)
+ if (!touchTarget.get())
continue;
- RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget, point.id(),
+ RefPtr<Touch> touch = Touch::create(doc->frame(), touchTarget.get(), point.id(),
point.screenPos().x(), point.screenPos().y(),
adjustedPageX, adjustedPageY);