Backed out changeset 3e2a441357ca (bug 1351148)
authorStone Shih <sshih@mozilla.com>
Fri, 11 Aug 2017 15:18:57 +0800
changeset 374244 f6bb01f04d7f907dacc509d90f7ce5a1e3c172b6
parent 374243 67c7b294ee26cb2a1f98ca7d6f5dfadc8dc205b8
child 374245 57c9319181a688df5377d7b2720dc5b346c3b601
push id32318
push userkwierso@gmail.com
push dateFri, 11 Aug 2017 20:16:01 +0000
treeherdermozilla-central@80ff3f300e05 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1351148
milestone57.0a1
backs out3e2a441357ca6adb89d5048e50e7b4e913d1f933
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
Backed out changeset 3e2a441357ca (bug 1351148)
dom/ipc/TabParent.cpp
dom/ipc/TabParent.h
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -168,17 +168,16 @@ TabParent::TabParent(nsIContentParent* a
 #ifdef DEBUG
   , mActiveSupressDisplayportCount(0)
 #endif
   , mLayerTreeEpoch(0)
   , mPreserveLayers(false)
   , mHasPresented(false)
   , mHasBeforeUnload(false)
   , mIsReadyToHandleInputEvents(false)
-  , mIsMouseEnterIntoWidgetEventSuppressed(false)
 {
   MOZ_ASSERT(aManager);
 }
 
 TabParent::~TabParent()
 {
 }
 
@@ -1088,17 +1087,17 @@ TabParent::SendKeyEvent(const nsAString&
   }
   Unused << PBrowserParent::SendKeyEvent(nsString(aType), aKeyCode, aCharCode,
                                          aModifiers, aPreventDefault);
 }
 
 void
 TabParent::SendRealMouseEvent(WidgetMouseEvent& aEvent)
 {
-  if (mIsDestroyed) {
+  if (mIsDestroyed || !mIsReadyToHandleInputEvents) {
     return;
   }
   aEvent.mRefPoint += GetChildProcessOffset();
 
   nsCOMPtr<nsIWidget> widget = GetWidget();
   if (widget) {
     // When we mouseenter the tab, the tab's cursor should
     // become the current cursor.  When we mouseexit, we stop.
@@ -1109,43 +1108,21 @@ TabParent::SendRealMouseEvent(WidgetMous
                           mCustomCursorHotspotX, mCustomCursorHotspotY);
       } else if (mCursor != nsCursor(-1)) {
         widget->SetCursor(mCursor);
       }
     } else if (eMouseExitFromWidget == aEvent.mMessage) {
       mTabSetsCursor = false;
     }
   }
-  if (!mIsReadyToHandleInputEvents) {
-    if (eMouseEnterIntoWidget == aEvent.mMessage) {
-      MOZ_ASSERT(!mIsMouseEnterIntoWidgetEventSuppressed);
-      mIsMouseEnterIntoWidgetEventSuppressed = true;
-    } else if (eMouseExitFromWidget == aEvent.mMessage) {
-      MOZ_ASSERT(mIsMouseEnterIntoWidgetEventSuppressed);
-      mIsMouseEnterIntoWidgetEventSuppressed = false;
-    }
-    return;
-  }
 
   ScrollableLayerGuid guid;
   uint64_t blockId;
   ApzAwareEventRoutingToChild(&guid, &blockId, nullptr);
 
-  if (mIsMouseEnterIntoWidgetEventSuppressed) {
-    // In the case that the TabParent suppressed the eMouseEnterWidget event due
-    // to its corresponding TabChild wasn't ready to handle it, we have to
-    // resend it when the TabChild is ready.
-    mIsMouseEnterIntoWidgetEventSuppressed = false;
-    WidgetMouseEvent localEvent(aEvent);
-    localEvent.mMessage = eMouseEnterIntoWidget;
-    DebugOnly<bool> ret = SendRealMouseButtonEvent(localEvent, guid, blockId);
-    NS_WARNING_ASSERTION(ret, "SendRealMouseButtonEvent(eMouseEnterIntoWidget) failed");
-    MOZ_ASSERT(!ret || localEvent.HasBeenPostedToRemoteProcess());
-  }
-
   if (eMouseMove == aEvent.mMessage) {
     if (aEvent.mReason == WidgetMouseEvent::eSynthesized) {
       DebugOnly<bool> ret = SendSynthMouseMoveEvent(aEvent, guid, blockId);
       NS_WARNING_ASSERTION(ret, "SendSynthMouseMoveEvent() failed");
       MOZ_ASSERT(!ret || aEvent.HasBeenPostedToRemoteProcess());
       return;
     }
     DebugOnly<bool> ret = SendRealMouseMoveEvent(aEvent, guid, blockId);
--- a/dom/ipc/TabParent.h
+++ b/dom/ipc/TabParent.h
@@ -781,21 +781,16 @@ private:
 
   // True if at least one window hosted in the TabChild has added a
   // beforeunload event listener.
   bool mHasBeforeUnload;
 
   // True when the remote browser is created and ready to handle input events.
   bool mIsReadyToHandleInputEvents;
 
-  // True if we suppress the eMouseEnterIntoWidget event due to the TabChild was
-  // not ready to handle it. We will resend it when the next time we fire a
-  // mouse event and the TabChild is ready.
-  bool mIsMouseEnterIntoWidgetEventSuppressed;
-
 public:
   static TabParent* GetTabParentFromLayersId(uint64_t aLayersId);
 };
 
 struct MOZ_STACK_CLASS TabParent::AutoUseNewTab final
 {
 public:
   AutoUseNewTab(TabParent* aNewTab, nsCString* aURLToLoad)