Bug 1209841 - Support mouse long tap in SendMouseEvent(). r=smaug
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 30 Sep 2015 18:29:35 +0800
changeset 265581 598be8e7d8bbb26b77fd86033d3ccc1577de9fa6
parent 265580 249c0fb67efa298ae262ec5d217258fa1634a9af
child 265582 8e7b4e096ae37abee12c5da5e3b91094258b7fed
push id15472
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:51:34 +0000
treeherderfx-team@2c33ef6b27e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1209841
milestone44.0a1
Bug 1209841 - Support mouse long tap in SendMouseEvent(). r=smaug This is for synthesizing mouse long tap in marionette test for AccessibleCaret.
dom/base/nsContentUtils.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7813,33 +7813,36 @@ nsContentUtils::SendMouseEvent(nsCOMPtr<
 {
   nsPoint offset;
   nsCOMPtr<nsIWidget> widget = GetWidget(aPresShell, &offset);
   if (!widget)
     return NS_ERROR_FAILURE;
 
   EventMessage msg;
   bool contextMenuKey = false;
-  if (aType.EqualsLiteral("mousedown"))
+  if (aType.EqualsLiteral("mousedown")) {
     msg = eMouseDown;
-  else if (aType.EqualsLiteral("mouseup"))
+  } else if (aType.EqualsLiteral("mouseup")) {
     msg = eMouseUp;
-  else if (aType.EqualsLiteral("mousemove"))
+  } else if (aType.EqualsLiteral("mousemove")) {
     msg = eMouseMove;
-  else if (aType.EqualsLiteral("mouseover"))
+  } else if (aType.EqualsLiteral("mouseover")) {
     msg = eMouseEnterIntoWidget;
-  else if (aType.EqualsLiteral("mouseout"))
+  } else if (aType.EqualsLiteral("mouseout")) {
     msg = eMouseExitFromWidget;
-  else if (aType.EqualsLiteral("contextmenu")) {
+  } else if (aType.EqualsLiteral("mouselongtap")) {
+    msg = eMouseLongTap;
+  } else if (aType.EqualsLiteral("contextmenu")) {
     msg = eContextMenu;
     contextMenuKey = (aButton == 0);
-  } else if (aType.EqualsLiteral("MozMouseHittest"))
+  } else if (aType.EqualsLiteral("MozMouseHittest")) {
     msg = eMouseHitTest;
-  else
+  } else {
     return NS_ERROR_FAILURE;
+  }
 
   if (aInputSourceArg == nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN) {
     aInputSourceArg = nsIDOMMouseEvent::MOZ_SOURCE_MOUSE;
   }
 
   WidgetMouseEvent event(true, msg, widget, WidgetMouseEvent::eReal,
                          contextMenuKey ? WidgetMouseEvent::eContextMenuKey :
                                           WidgetMouseEvent::eNormal);