Bug 1162050 - Remove instances of eLegacyDragGesture and draggesture. r=enn
☠☠ backed out by 578c5f187aae ☠ ☠
authorJimmy Wang <jimmyw22@gmail.com>
Fri, 27 May 2016 14:32:59 -0400
changeset 304471 f8fe3acf2e78
parent 304470 2d7f3aa49d4d
child 304472 f940ad94cc9d
push id30426
push usercbook@mozilla.com
push date2016-07-11 14:21 +0000
treeherdermozilla-central@214884d507ee [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn
bugs1162050
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 1162050 - Remove instances of eLegacyDragGesture and draggesture. r=enn MozReview-Commit-ID: 8kP1AY4peos
dom/base/nsContentUtils.cpp
dom/base/nsGkAtomList.h
dom/events/DataTransfer.cpp
dom/events/EventNameList.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/xul/nsXULElement.cpp
editor/libeditor/EditorEventListener.h
widget/EventMessageList.h
widget/WidgetEventImpl.cpp
widget/nsBaseWidget.cpp
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -5362,21 +5362,21 @@ nsContentUtils::GetDragSession()
 /* static */
 nsresult
 nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
 {
   if (aDragEvent->mDataTransfer || !aDragEvent->IsTrusted()) {
     return NS_OK;
   }
 
-  // For draggesture and dragstart events, the data transfer object is
+  // For dragstart events, the data transfer object is
   // created before the event fires, so it should already be set. For other
   // drag events, get the object from the drag session.
-  NS_ASSERTION(aDragEvent->mMessage != eLegacyDragGesture &&
-               aDragEvent->mMessage != eDragStart,
+  // Note that eLegacyDragGesture has been replaced by eDragStart.
+  NS_ASSERTION(aDragEvent->mMessage != eDragStart,
                "draggesture event created without a dataTransfer");
 
   nsCOMPtr<nsIDragSession> dragSession = GetDragSession();
   NS_ENSURE_TRUE(dragSession, NS_OK); // no drag in progress
 
   nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
   nsCOMPtr<DataTransfer> initialDataTransfer;
   dragSession->GetDataTransfer(getter_AddRefs(dataTransfer));
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -329,17 +329,16 @@ GK_ATOM(DOMSubtreeModified, "DOMSubtreeM
 GK_ATOM(double_, "double")
 GK_ATOM(drag, "drag")
 GK_ATOM(dragdrop, "dragdrop")
 GK_ATOM(dragend, "dragend")
 GK_ATOM(dragenter, "dragenter")
 GK_ATOM(dragevent, "dragevent")
 GK_ATOM(dragexit, "dragexit")
 GK_ATOM(draggable, "draggable")
-GK_ATOM(draggesture, "draggesture")
 GK_ATOM(dragging, "dragging")
 GK_ATOM(dragleave, "dragleave")
 GK_ATOM(dragover, "dragover")
 GK_ATOM(dragSession, "dragSession")
 GK_ATOM(dragstart, "dragstart")
 GK_ATOM(drawintitlebar, "drawintitlebar")
 GK_ATOM(drawtitle, "drawtitle")
 GK_ATOM(drop, "drop")
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -97,18 +97,17 @@ DataTransfer::DataTransfer(nsISupports* 
   , mDragImageY(0)
 {
   mItems = new DataTransferItemList(this, aIsExternal, false /* aIsCrossDomainSubFrameDrop */);
   // For these events, we want to be able to add data to the data transfer, so
   // clear the readonly state. Otherwise, the data is already present. For
   // external usage, cache the data from the native clipboard or drag.
   if (aEventMessage == eCut ||
       aEventMessage == eCopy ||
-      aEventMessage == eDragStart ||
-      aEventMessage == eLegacyDragGesture) {
+      aEventMessage == eDragStart) {
     mReadOnly = false;
   } else if (mIsExternal) {
     if (aEventMessage == ePaste) {
       CacheExternalClipboardFormats();
     } else if (aEventMessage >= eDragDropEventFirst &&
                aEventMessage <= eDragDropEventLast) {
       CacheExternalDragFormats();
     }
@@ -144,21 +143,20 @@ DataTransfer::DataTransfer(nsISupports* 
   MOZ_ASSERT(mParent);
   MOZ_ASSERT(aItems);
 
   // We clone the items array after everything else, so that it has a valid
   // mParent value
   mItems = aItems->Clone(this);
   // The items are copied from aItems into mItems. There is no need to copy
   // the actual data in the items as the data transfer will be read only. The
-  // draggesture and dragstart events are the only times when items are
+  // dragstart event is the only time when items are
   // modifiable, but those events should have been using the first constructor
   // above.
-  NS_ASSERTION(aEventMessage != eLegacyDragGesture &&
-               aEventMessage != eDragStart,
+  NS_ASSERTION(aEventMessage != eDragStart,
                "invalid event type for DataTransfer constructor");
 }
 
 DataTransfer::~DataTransfer()
 {}
 
 // static
 already_AddRefed<DataTransfer>
--- a/dom/events/EventNameList.h
+++ b/dom/events/EventNameList.h
@@ -773,20 +773,16 @@ NON_IDL_EVENT(commandupdate,
 NON_IDL_EVENT(dragexit,
               eDragExit,
               EventNameType_XUL,
               eDragEventClass)
 NON_IDL_EVENT(dragdrop,
               eLegacyDragDrop,
               EventNameType_XUL,
               eDragEventClass)
-NON_IDL_EVENT(draggesture,
-              eLegacyDragGesture,
-              EventNameType_XUL,
-              eDragEventClass)
 NON_IDL_EVENT(overflow,
               eScrollPortOverflow,
               EventNameType_XUL,
               eBasicEventClass)
 NON_IDL_EVENT(underflow,
               eScrollPortUnderflow,
               EventNameType_XUL,
               eBasicEventClass)
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -2908,17 +2908,16 @@ nsPluginInstanceOwner::Destroy()
   content->RemoveEventListener(NS_LITERAL_STRING("drop"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragdrop"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("drag"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragenter"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragover"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragleave"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragexit"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragstart"), this, true);
-  content->RemoveEventListener(NS_LITERAL_STRING("draggesture"), this, true);
   content->RemoveEventListener(NS_LITERAL_STRING("dragend"), this, true);
   content->RemoveSystemEventListener(NS_LITERAL_STRING("compositionstart"),
                                      this, true);
   content->RemoveSystemEventListener(NS_LITERAL_STRING("compositionend"),
                                      this, true);
   content->RemoveSystemEventListener(NS_LITERAL_STRING("text"), this, true);
 
 #if MOZ_WIDGET_ANDROID
@@ -3308,17 +3307,16 @@ nsresult nsPluginInstanceOwner::Init(nsI
   aContent->AddEventListener(NS_LITERAL_STRING("drop"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragdrop"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("drag"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragenter"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragover"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragleave"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragexit"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragstart"), this, true);
-  aContent->AddEventListener(NS_LITERAL_STRING("draggesture"), this, true);
   aContent->AddEventListener(NS_LITERAL_STRING("dragend"), this, true);
   aContent->AddSystemEventListener(NS_LITERAL_STRING("compositionstart"),
     this, true);
   aContent->AddSystemEventListener(NS_LITERAL_STRING("compositionend"), this,
     true);
   aContent->AddSystemEventListener(NS_LITERAL_STRING("text"), this, true);
 
   return NS_OK;
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1275,18 +1275,17 @@ nsXULElement::PreHandleEvent(EventChainP
 {
     aVisitor.mForceContentDispatch = true; //FIXME! Bug 329119
     if (IsRootOfNativeAnonymousSubtree() &&
         (IsAnyOfXULElements(nsGkAtoms::scrollbar, nsGkAtoms::scrollcorner)) &&
         (aVisitor.mEvent->mMessage == eMouseClick ||
          aVisitor.mEvent->mMessage == eMouseDoubleClick ||
          aVisitor.mEvent->mMessage == eXULCommand ||
          aVisitor.mEvent->mMessage == eContextMenu ||
-         aVisitor.mEvent->mMessage == eDragStart ||
-         aVisitor.mEvent->mMessage == eLegacyDragGesture)) {
+         aVisitor.mEvent->mMessage == eDragStart)) {
         // Don't propagate these events from native anonymous scrollbar.
         aVisitor.mCanHandle = true;
         aVisitor.mParentTarget = nullptr;
         return NS_OK;
     }
     if (aVisitor.mEvent->mMessage == eXULCommand &&
         aVisitor.mEvent->mClass == eInputEventClass &&
         aVisitor.mEvent->mOriginalTarget == static_cast<nsIContent*>(this) &&
--- a/editor/libeditor/EditorEventListener.h
+++ b/editor/libeditor/EditorEventListener.h
@@ -67,17 +67,16 @@ protected:
   virtual nsresult MouseUp(nsIDOMMouseEvent* aMouseEvent) { return NS_OK; }
   virtual nsresult MouseClick(nsIDOMMouseEvent* aMouseEvent);
   nsresult Focus(nsIDOMEvent* aEvent);
   nsresult Blur(nsIDOMEvent* aEvent);
   nsresult DragEnter(nsIDOMDragEvent* aDragEvent);
   nsresult DragOver(nsIDOMDragEvent* aDragEvent);
   nsresult DragExit(nsIDOMDragEvent* aDragEvent);
   nsresult Drop(nsIDOMDragEvent* aDragEvent);
-  nsresult DragGesture(nsIDOMDragEvent* aDragEvent);
 
   bool CanDrop(nsIDOMDragEvent* aEvent);
   void CleanupDragDropCaret();
   already_AddRefed<nsIPresShell> GetPresShell();
   nsPresContext* GetPresContext();
   nsIContent* GetFocusedRootContent();
   // Returns true if IME consumes the mouse event.
   bool NotifyIMEOfMouseButtonEvent(nsIDOMMouseEvent* aMouseEvent);
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -127,17 +127,16 @@ NS_EVENT_MESSAGE(eFormInvalid)
 //Need separate focus/blur notifications for non-native widgets
 NS_EVENT_MESSAGE(eFocus)
 NS_EVENT_MESSAGE(eBlur)
 
 NS_EVENT_MESSAGE(eDragEnter)
 NS_EVENT_MESSAGE(eDragOver)
 NS_EVENT_MESSAGE(eDragExit)
 NS_EVENT_MESSAGE(eLegacyDragDrop)
-NS_EVENT_MESSAGE(eLegacyDragGesture)
 NS_EVENT_MESSAGE(eDrag)
 NS_EVENT_MESSAGE(eDragEnd)
 NS_EVENT_MESSAGE(eDragStart)
 NS_EVENT_MESSAGE(eDrop)
 NS_EVENT_MESSAGE(eDragLeave)
 NS_EVENT_MESSAGE_FIRST_LAST(eDragDropEvent, eDragEnter, eDragLeave)
 
 // XUL specific events
--- a/widget/WidgetEventImpl.cpp
+++ b/widget/WidgetEventImpl.cpp
@@ -209,17 +209,16 @@ WidgetEvent::HasMouseEventMessage() cons
 bool
 WidgetEvent::HasDragEventMessage() const
 {
   switch (mMessage) {
     case eDragEnter:
     case eDragOver:
     case eDragExit:
     case eLegacyDragDrop:
-    case eLegacyDragGesture:
     case eDrag:
     case eDragEnd:
     case eDragStart:
     case eDrop:
     case eDragLeave:
       return true;
     default:
       return false;
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -2910,17 +2910,16 @@ nsBaseWidget::debug_GuiEventToString(Wid
   nsAutoString eventName(NS_LITERAL_STRING("UNKNOWN"));
 
 #define _ASSIGN_eventName(_value,_name)\
 case _value: eventName.AssignLiteral(_name) ; break
 
   switch(aGuiEvent->mMessage)
   {
     _ASSIGN_eventName(eBlur,"eBlur");
-    _ASSIGN_eventName(eLegacyDragGesture,"eLegacyDragGesture");
     _ASSIGN_eventName(eDrop,"eDrop");
     _ASSIGN_eventName(eDragEnter,"eDragEnter");
     _ASSIGN_eventName(eDragExit,"eDragExit");
     _ASSIGN_eventName(eDragOver,"eDragOver");
     _ASSIGN_eventName(eEditorInput,"eEditorInput");
     _ASSIGN_eventName(eFocus,"eFocus");
     _ASSIGN_eventName(eFormSelect,"eFormSelect");
     _ASSIGN_eventName(eFormChange,"eFormChange");