Bug 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 20 Jun 2016 12:52:47 -0400
changeset 302101 4e6b1c5bc5bf71c84ce30d37cf4944b4c2d3f761
parent 302100 54d410626a98bfb517445a727c2683e81fa3105e
child 302102 c4be443b20d068b1a18b6929c6e2f76fef4de235
push id78592
push userkgupta@mozilla.com
push dateMon, 20 Jun 2016 17:05:57 +0000
treeherdermozilla-inbound@4e6b1c5bc5bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarker
bugs1280805
milestone50.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 1280805 - Don't assert in the valid case where the child process gets an event with an input block id but no mHandledByAPZ. r=rbarker MozReview-Commit-ID: 9L4xdnoSJ0p
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1916,63 +1916,65 @@ TabChild::RecvSynthMouseMoveEvent(const 
   return RecvRealMouseButtonEvent(aEvent, aGuid, aInputBlockId);
 }
 
 bool
 TabChild::RecvRealMouseButtonEvent(const WidgetMouseEvent& aEvent,
                                    const ScrollableLayerGuid& aGuid,
                                    const uint64_t& aInputBlockId)
 {
-  if (aInputBlockId) {
-    MOZ_ASSERT(aEvent.mFlags.mHandledByAPZ);
+  // Mouse events like eMouseEnterIntoWidget, that are created in the parent
+  // process EventStateManager code, have an input block id which they get from
+  // the InputAPZContext in the parent process stack. However, they did not
+  // actually go through the APZ code and so their mHandledByAPZ flag is false.
+  // Since thos events didn't go through APZ, we don't need to send notifications
+  // for them.
+  if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
     nsCOMPtr<nsIDocument> document(GetDocument());
     APZCCallbackHelper::SendSetTargetAPZCNotification(
       mPuppetWidget, document, aEvent, aGuid, aInputBlockId);
   }
 
   nsEventStatus unused;
   InputAPZContext context(aGuid, aInputBlockId, unused);
 
   WidgetMouseEvent localEvent(aEvent);
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
       mPuppetWidget->GetDefaultScale());
   APZCCallbackHelper::DispatchWidgetEvent(localEvent);
 
-  if (aInputBlockId) {
-    MOZ_ASSERT(aEvent.mFlags.mHandledByAPZ);
+  if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
     mAPZEventState->ProcessMouseEvent(aEvent, aGuid, aInputBlockId);
   }
   return true;
 }
 
 bool
 TabChild::RecvMouseWheelEvent(const WidgetWheelEvent& aEvent,
                               const ScrollableLayerGuid& aGuid,
                               const uint64_t& aInputBlockId)
 {
-  if (aInputBlockId) {
-    MOZ_ASSERT(aEvent.mFlags.mHandledByAPZ);
+  if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
     nsCOMPtr<nsIDocument> document(GetDocument());
     APZCCallbackHelper::SendSetTargetAPZCNotification(
       mPuppetWidget, document, aEvent, aGuid, aInputBlockId);
   }
 
   WidgetWheelEvent localEvent(aEvent);
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
       mPuppetWidget->GetDefaultScale());
   APZCCallbackHelper::DispatchWidgetEvent(localEvent);
 
   if (localEvent.mCanTriggerSwipe) {
     SendRespondStartSwipeEvent(aInputBlockId, localEvent.TriggersSwipe());
   }
 
-  if (aInputBlockId) {
-    MOZ_ASSERT(aEvent.mFlags.mHandledByAPZ);
+  if (aInputBlockId && aEvent.mFlags.mHandledByAPZ) {
     mAPZEventState->ProcessWheelEvent(localEvent, aGuid, aInputBlockId);
   }
   return true;
 }
 
 bool
 TabChild::RecvMouseScrollTestEvent(const uint64_t& aLayersId,
                                    const FrameMetrics::ViewID& aScrollId, const nsString& aEvent)