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

Unified Diff: third_party/WebKit/Source/core/input/PointerEventManager.cpp

Issue 1838973003: Send lostpointercapture on touch capturing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6a72585c91afbf8411d2cacaa99ef3cc2aeff9be 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -307,7 +307,12 @@ void PointerEventManager::sendTouchCancelPointerEvent(PassRefPtrWillBeRawPtr<Eve
getEffectiveTargetForPointerEvent(target, pointerEvent->pointerId()),
pointerEvent.get());
- setNodeUnderPointer(pointerEvent, nullptr);
+ releasePointerCapture(pointerEvent->pointerId());
+
+ // Sending the leave/out events and lostpointercapture
+ // because the next touch event will have a different id. So delayed
+ // sending of lostpointercapture won't work here.
+ processCaptureAndPositionOfPointerEvent(pointerEvent, nullptr);
removePointer(pointerEvent);
}
@@ -332,9 +337,19 @@ WebInputEventResult PointerEventManager::sendTouchPointerEvent(
getEffectiveTargetForPointerEvent(target, pointerEvent->pointerId()),
pointerEvent.get());
+ // Setting the implicit capture for touch
+ if (touchPoint.state() == PlatformTouchPoint::TouchPressed)
+ setPointerCapture(pointerEvent->pointerId(), target);
+
if (touchPoint.state() == PlatformTouchPoint::TouchReleased
|| touchPoint.state() == PlatformTouchPoint::TouchCancelled) {
- setNodeUnderPointer(pointerEvent, nullptr);
+ releasePointerCapture(pointerEvent->pointerId());
+
+ // Sending the leave/out events and lostpointercapture
+ // because the next touch event will have a different id. So delayed
+ // sending of lostpointercapture won't work here.
+ processCaptureAndPositionOfPointerEvent(pointerEvent, nullptr);
+
removePointer(pointerEvent);
}
@@ -401,6 +416,8 @@ void PointerEventManager::clear()
m_preventMouseEventForPointerTypeMouse = false;
m_pointerEventFactory.clear();
m_nodeUnderPointer.clear();
+ m_pointerCaptureTarget.clear();
+ m_pendingPointerCaptureTarget.clear();
}
void PointerEventManager::processCaptureAndPositionOfPointerEvent(
@@ -566,6 +583,12 @@ bool PointerEventManager::isActive(const int pointerId)
return m_pointerEventFactory.isActive(pointerId);
}
+WebPointerProperties::PointerType PointerEventManager::getPointerEventType(
+ const int pointerId)
+{
+ return m_pointerEventFactory.getPointerType(pointerId);
+}
+
DEFINE_TRACE(PointerEventManager)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698