Bug 1507615 - part1 : don't activate document if the 'pointdown' is originated from touch event r=smaug
authoralwu <alwu@mozilla.com>
Tue, 20 Nov 2018 01:20:09 +0000
changeset 503510 f0879820fc44ee68410702f98024c2c841da382d
parent 503509 b876444d90a674ae6a19311a495de483031f95c2
child 503511 dba5cff2fd640bb82eb15988b095679262f5b621
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1507615
milestone65.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 1507615 - part1 : don't activate document if the 'pointdown' is originated from touch event r=smaug For touch events, we use 'touchend' to activate document, because 'touchstart' can be the start of either draging or touch. As 'pointdown' is a precedent event of the 'touchstart', we should not activate document if the source of event is from touch event. Differential Revision: https://phabricator.services.mozilla.com/D12333
dom/events/EventStateManager.cpp
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -656,23 +656,19 @@ EventStateManager::PreHandleEvent(nsPres
       aEvent->mMessage = eVoidEvent;
       break;
     }
     MOZ_FALLTHROUGH;
   case eMouseMove:
   case ePointerDown:
     if (aEvent->mMessage == ePointerDown) {
       PointerEventHandler::ImplicitlyCapturePointer(aTargetFrame, aEvent);
-#ifndef MOZ_WIDGET_ANDROID
-      // Pointer events aren't enabled on Android yet, but when they
-      // are enabled, we should not activate on pointerdown, as that
-      // fires for touches that turn into moves on Android, and we don't
-      // want to gesture activate for scroll actions.
-      NotifyTargetUserActivation(aEvent, aTargetContent);
-#endif
+      if (mouseEvent->inputSource != MouseEvent_Binding::MOZ_SOURCE_TOUCH) {
+        NotifyTargetUserActivation(aEvent, aTargetContent);
+      }
     }
     MOZ_FALLTHROUGH;
   case ePointerMove: {
     // on the Mac, GenerateDragGesture() may not return until the drag
     // has completed and so |aTargetFrame| may have been deleted (moving
     // a bookmark, for example).  If this is the case, however, we know
     // that ClearFrameRefs() has been called and it cleared out
     // |mCurrentTarget|. As a result, we should pass |mCurrentTarget|