Index: third_party/WebKit/Source/core/input/PointerEventManager.cpp |
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
index 5a18188771175f635344fb342c9b6c0b0ac91bbf..dd68d96ae390ad8dc3dc08e3bd54161b75ac95ed 100644 |
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp |
@@ -307,7 +307,10 @@ void PointerEventManager::sendTouchCancelPointerEvent(PassRefPtrWillBeRawPtr<Eve |
getEffectiveTargetForPointerEvent(target, pointerEvent->pointerId()), |
pointerEvent.get()); |
- setNodeUnderPointer(pointerEvent, nullptr); |
+ releasePointerCapture(pointerEvent->pointerId()); |
+ |
+ // Sending the leave/out events as well as lostpointercapture if required |
+ processCaptureAndPositionOfPointerEvent(pointerEvent, nullptr); |
removePointer(pointerEvent); |
} |
@@ -319,11 +322,12 @@ WebInputEventResult PointerEventManager::sendTouchPointerEvent( |
const double clientX, const double clientY) |
{ |
RefPtrWillBeRawPtr<EventTarget> target = prpTarget; |
+ bool isNew = false; |
RefPtrWillBeRawPtr<PointerEvent> pointerEvent = |
m_pointerEventFactory.create( |
pointerEventNameForTouchPointState(touchPoint.state()), |
- touchPoint, modifiers, width, height, clientX, clientY); |
+ touchPoint, modifiers, width, height, clientX, clientY, isNew); |
processCaptureAndPositionOfPointerEvent(pointerEvent, target); |
@@ -332,9 +336,17 @@ WebInputEventResult PointerEventManager::sendTouchPointerEvent( |
getEffectiveTargetForPointerEvent(target, pointerEvent->pointerId()), |
pointerEvent.get()); |
+ // Setting the implicit capture for touch |
+ if (isNew) |
+ setPointerCapture(pointerEvent->pointerId(), target); |
+ |
if (touchPoint.state() == PlatformTouchPoint::TouchReleased |
|| touchPoint.state() == PlatformTouchPoint::TouchCancelled) { |
- setNodeUnderPointer(pointerEvent, nullptr); |
+ releasePointerCapture(pointerEvent->pointerId()); |
+ |
+ // Sending the leave/out events as well as lostpointercapture if required |
+ processCaptureAndPositionOfPointerEvent(pointerEvent, nullptr); |
+ |
removePointer(pointerEvent); |
} |
@@ -401,6 +413,8 @@ void PointerEventManager::clear() |
m_preventMouseEventForPointerTypeMouse = false; |
m_pointerEventFactory.clear(); |
m_nodeUnderPointer.clear(); |
+ m_pointerCaptureTarget.clear(); |
+ m_pendingPointerCaptureTarget.clear(); |
} |
void PointerEventManager::processCaptureAndPositionOfPointerEvent( |