Bug 1507615 - part1 : don't activate document if the 'pointdown' is originated from touch event r=smaug
☠☠ backed out by 8f5052d9f149 ☠ ☠
authoralwu <alwu@mozilla.com>
Mon, 19 Nov 2018 21:11:16 +0000
changeset 503506 a7c904c9581ffe0a02b548521a1bc052441b7715
parent 503505 817c31467dcb1ee977a92cf9e07af04da8dbe343
child 503507 8ad653a7a5d6e32fc4910275aee651ce8b686fc8
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|