Bug 1223296 - Clear element activation if a contextmenu is displayed. r?botond draft
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 12 Nov 2015 15:40:15 -0500
changeset 308520 93b8dfb05273175ea0cfca9432de2007de482a2b
parent 308519 a4ddf5362f5889a1408bc838e12be078b118b30e
child 511176 0bdbd7b625872157d3faa0a5b1ab5a54c3ac788f
push id7486
push userkgupta@mozilla.com
push dateThu, 12 Nov 2015 20:40:53 +0000
reviewersbotond
bugs1223296
milestone45.0a1
Bug 1223296 - Clear element activation if a contextmenu is displayed. r?botond
gfx/layers/apz/util/APZEventState.cpp
--- a/gfx/layers/apz/util/APZEventState.cpp
+++ b/gfx/layers/apz/util/APZEventState.cpp
@@ -226,16 +226,21 @@ APZEventState::ProcessLongTap(const nsCO
   // including in JS code, so it's not trivial to change.
   bool eventHandled =
       APZCCallbackHelper::DispatchMouseEvent(aPresShell, NS_LITERAL_STRING("contextmenu"),
                          APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid),
                          2, 1, WidgetModifiersToDOMModifiers(aModifiers), true,
                          nsIDOMMouseEvent::MOZ_SOURCE_TOUCH);
 
   APZES_LOG("Contextmenu event handled: %d\n", eventHandled);
+  if (eventHandled) {
+    // If the contextmenu event was handled then we're showing a contextmenu,
+    // and so we should remove any activation
+    mActiveElementManager->ClearActivation();
+  }
 
   // If no one handle context menu, fire MOZLONGTAP event
   if (!eventHandled) {
     LayoutDevicePoint currentPoint =
         APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid)
       * widget->GetDefaultScale();
     int time = 0;
     nsEventStatus status =