Backed out changeset 15b71aceffb4 (bug 1383485)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 28 Jul 2017 09:20:02 +0200
changeset 422554 fd5cc34890a569315fa9b6b1cc30f28ddcb7e308
parent 422553 e946980577ab66cde5f2b9baf8cb8493d8183b6c
child 422555 01b583d44fff643649d2f6c6ec0e299990f4426e
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1383485
milestone56.0a1
backs out15b71aceffb44d3ec2f3c1016cf36aac4a0bbd71
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 15b71aceffb4 (bug 1383485)
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)