Bug 966493 - Mark touchstart and end events as handling user input. r=smaug, a=lmandel
authorWes Johnston <wjohnston@mozilla.com>
Tue, 09 Sep 2014 15:10:07 -0700
changeset 225770 f6c14ee20738
parent 225769 65f5bf99d815
child 225771 7d2f3db4567d
push id4012
push userryanvm@gmail.com
push date2014-10-22 22:38 +0000
treeherdermozilla-beta@f6c14ee20738 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, lmandel
bugs966493
milestone34.0
Bug 966493 - Mark touchstart and end events as handling user input. r=smaug, a=lmandel
layout/base/nsPresShell.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -7586,16 +7586,17 @@ PresShell::HandleEventInternal(WidgetEve
         // Else not full-screen mode or key code is unrestricted, fall
         // through to normal handling.
       }
       case NS_MOUSE_BUTTON_DOWN:
       case NS_MOUSE_BUTTON_UP:
         isHandlingUserInput = true;
         break;
       case NS_TOUCH_START: {
+        isHandlingUserInput = true;
         WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
         // if there is only one touch in this touchstart event, assume that it is
         // the start of a new touch session and evict any old touches in the
         // queue
         if (touchEvent->touches.Length() == 1) {
           WidgetTouchEvent::AutoTouchArray touches;
           gCaptureTouchList->Enumerate(&AppendToTouchList, (void *)&touches);
           for (uint32_t i = 0; i < touches.Length(); ++i) {
@@ -7610,18 +7611,20 @@ PresShell::HandleEventInternal(WidgetEve
             // If it is not already in the queue, it is a new touch
             touch->mChanged = true;
           }
           touch->mMessage = aEvent->message;
           gCaptureTouchList->Put(id, touch);
         }
         break;
       }
-      case NS_TOUCH_CANCEL:
-      case NS_TOUCH_END: {
+      case NS_TOUCH_END:
+        isHandlingUserInput = true;
+        // Fall through to touchcancel code
+      case NS_TOUCH_CANCEL: {
         // Remove the changed touches
         // need to make sure we only remove touches that are ending here
         WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
         WidgetTouchEvent::TouchArray& touches = touchEvent->touches;
         for (uint32_t i = 0; i < touches.Length(); ++i) {
           dom::Touch* touch = touches[i];
           if (!touch) {
             continue;