Bug 1404255 - [Pointer Event] Turn off active state or remove current pointer from active pointers when handling pointercancel. r=masayuki
authorStone Shih <sshih@mozilla.com>
Fri, 29 Sep 2017 17:03:48 +0800
changeset 384891 e7c9f37690bdc188100d4e8c397acce8ffbbe5e0
parent 384890 bdfe95610f086e7c42f024dc4402d50ebecba916
child 384892 a0b6b6ff331354ee30eb4f67dbeb061357c5101f
push id95880
push userarchaeopteryx@coole-files.de
push dateSat, 07 Oct 2017 08:58:44 +0000
treeherdermozilla-inbound@156942799371 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1404255
milestone58.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1404255 - [Pointer Event] Turn off active state or remove current pointer from active pointers when handling pointercancel. r=masayuki MozReview-Commit-ID: 60FEfcvtxRd
dom/events/PointerEventHandler.cpp
--- a/dom/events/PointerEventHandler.cpp
+++ b/dom/events/PointerEventHandler.cpp
@@ -103,16 +103,20 @@ PointerEventHandler::UpdateActivePointer
   case ePointerDown:
     // In this case we switch pointer to active state
     if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
       sActivePointersIds->Put(pointerEvent->pointerId,
                               new PointerInfo(true, pointerEvent->inputSource,
                                               pointerEvent->mIsPrimary));
     }
     break;
+  case ePointerCancel:
+    // pointercancel means a pointer is unlikely to continue to produce pointer
+    // events. In that case, we should turn off active state or remove the
+    // pointer from active pointers.
   case ePointerUp:
     // In this case we remove information about pointer or turn off active state
     if (WidgetPointerEvent* pointerEvent = aEvent->AsPointerEvent()) {
       if(pointerEvent->inputSource != nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
         sActivePointersIds->Put(pointerEvent->pointerId,
                                 new PointerInfo(false,
                                                 pointerEvent->inputSource,
                                                 pointerEvent->mIsPrimary));