backout Bug 1414204 because of regressions, r=backout
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 03 Jan 2018 18:42:50 +0200
changeset 451915 a53f97560b8fd38fdcac5436225afb38e705a215
parent 451914 4ee98f9838ef094cf6c3818dea94e8da62bf65eb
child 451916 73c3034830d9743c201eb9bb8fd6c87a23b33f4f
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1414204
milestone59.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
backout Bug 1414204 because of regressions, r=backout
dom/events/EventStateManager.cpp
dom/events/EventStateManager.h
layout/base/PresShell.cpp
widget/nsDragServiceProxy.cpp
widget/nsDragServiceProxy.h
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -285,18 +285,16 @@ TimeStamp EventStateManager::sLatestUser
 TimeStamp EventStateManager::sHandlingInputStart;
 
 EventStateManager::WheelPrefs*
   EventStateManager::WheelPrefs::sInstance = nullptr;
 bool EventStateManager::WheelPrefs::sWheelEventsEnabledOnPlugins = true;
 EventStateManager::DeltaAccumulator*
   EventStateManager::DeltaAccumulator::sInstance = nullptr;
 
-bool EventStateManager::sIsInputEventsSuppressed = false;
-
 EventStateManager::EventStateManager()
   : mLockCursor(0)
   , mLastFrameConsumedSetCursor(false)
   , mCurrentTarget(nullptr)
     // init d&d gesture state machine variables
   , mGestureDownPoint(0,0)
   , mPresContext(nullptr)
   , mLClickCount(0)
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -310,32 +310,16 @@ public:
   static void GetUserPrefsForWheelEvent(const WidgetWheelEvent* aEvent,
                                         double* aOutMultiplierX,
                                         double* aOutMultiplierY);
 
   // Returns whether or not a frame can be vertically scrolled with a mouse
   // wheel (as opposed to, say, a selection or touch scroll).
   static bool CanVerticallyScrollFrameWithWheel(nsIFrame* aFrame);
 
-  static void SuppressInputEvents()
-  {
-    MOZ_ASSERT(!sIsInputEventsSuppressed);
-    sIsInputEventsSuppressed = true;
-  }
-
-  static void UnsuppressInputEvents()
-  {
-    sIsInputEventsSuppressed = false;
-  }
-
-  static bool IsInputEventsSuppressed()
-  {
-    return sIsInputEventsSuppressed;
-  }
-
   // Holds the point in screen coords that a mouse event was dispatched to,
   // before we went into pointer lock mode. This is constantly updated while
   // the pointer is not locked, but we don't update it while the pointer is
   // locked. This is used by dom::Event::GetScreenCoords() to make mouse
   // events' screen coord appear frozen at the last mouse position while
   // the pointer is locked.
   static CSSIntPoint sLastScreenPoint;
 
@@ -1099,18 +1083,16 @@ private:
   // Time at which we began handling user input. Reset to the epoch
   // once we have finished handling user input.
   static TimeStamp sHandlingInputStart;
 
   // Time at which we began handling the latest user input. Not reset
   // at the end of the input.
   static TimeStamp sLatestUserInputStart;
 
-  static bool sIsInputEventsSuppressed;
-
   RefPtr<OverOutElementsWrapper> mMouseEnterLeaveHelper;
   nsRefPtrHashtable<nsUint32HashKey, OverOutElementsWrapper> mPointersEnterLeaveHelper;
 
 public:
   static nsresult UpdateUserActivityTimer(void);
   // Array for accesskey support
   nsCOMArray<nsIContent> mAccessKeys;
 
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6925,26 +6925,16 @@ PresShell::HandleEvent(nsIFrame* aFrame,
   }
 
   if (mIsDestroying ||
       (sDisableNonTestMouseEvents && !aEvent->mFlags.mIsSynthesizedForTests &&
        aEvent->HasMouseEventMessage())) {
     return NS_OK;
   }
 
-  if (EventStateManager::IsInputEventsSuppressed() &&
-      (aEvent->mClass == eMouseEventClass ||
-       aEvent->mClass == eWheelEventClass ||
-       aEvent->mClass == ePointerEventClass ||
-       aEvent->mClass == eTouchEventClass ||
-       aEvent->mClass == eKeyboardEventClass ||
-       aEvent->mClass == eCompositionEventClass)) {
-    return NS_OK;
-  }
-
   RecordMouseLocation(aEvent);
 
   if (AccessibleCaretEnabled(mDocument->GetDocShell())) {
     // We have to target the focus window because regardless of where the
     // touch goes, we want to access the copy paste manager.
     nsCOMPtr<nsPIDOMWindowOuter> window = GetFocusedDOMWindowInOurWindow();
     nsCOMPtr<nsIDocument> retargetEventDoc =
       window ? window->GetExtantDoc() : nullptr;
--- a/widget/nsDragServiceProxy.cpp
+++ b/widget/nsDragServiceProxy.cpp
@@ -4,17 +4,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDragServiceProxy.h"
 #include "nsIDocument.h"
 #include "nsISupportsPrimitives.h"
 #include "mozilla/dom/TabChild.h"
 #include "mozilla/gfx/2D.h"
-#include "mozilla/EventStateManager.h"
 #include "mozilla/UniquePtr.h"
 #include "mozilla/Unused.h"
 #include "nsContentUtils.h"
 
 using mozilla::ipc::Shmem;
 using mozilla::dom::TabChild;
 using mozilla::dom::OptionalShmem;
 using mozilla::LayoutDeviceIntRect;
@@ -84,26 +83,8 @@ nsDragServiceProxy::InvokeDragSessionImp
     }
   }
 
   mozilla::Unused << child->SendInvokeDragSession(dataTransfers, aActionType,
                                                   mozilla::void_t(), 0, 0, dragRect);
   StartDragSession();
   return NS_OK;
 }
-
-NS_IMETHODIMP
-nsDragServiceProxy::StartDragSession()
-{
-  // Normally, OS stops firing input events when a drag operation starts. But
-  // there may be some pending input events queued in the content process. We
-  // have to suppress them since spec says that input events must be suppressed
-  // when there is a dnd session.
-  EventStateManager::SuppressInputEvents();
-  return nsBaseDragService::StartDragSession();
-}
-
-NS_IMETHODIMP
-nsDragServiceProxy::EndDragSession(bool aDoneDrag, uint32_t aKeyModifiers)
-{
-  EventStateManager::UnsuppressInputEvents();
-  return nsBaseDragService::EndDragSession(aDoneDrag, aKeyModifiers);
-}
--- a/widget/nsDragServiceProxy.h
+++ b/widget/nsDragServiceProxy.h
@@ -14,18 +14,13 @@ public:
   nsDragServiceProxy();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   // nsBaseDragService
   virtual nsresult InvokeDragSessionImpl(nsIArray* anArrayTransferables,
                                          nsIScriptableRegion* aRegion,
                                          uint32_t aActionType) override;
-
-  // nsIDragService
-  NS_IMETHOD StartDragSession() override;
-  NS_IMETHOD EndDragSession(bool aDoneDrag, uint32_t aKeyModifiers) override;
-
 private:
   virtual ~nsDragServiceProxy();
 };
 
 #endif // NSDRAGSERVICEPROXY_H