Bug 1387143 part 4. Stop using nsISelection in remaining xpidl. r=mats
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 08 May 2018 13:52:36 -0400
changeset 474156 0328bcd0039ec3be9de874d7c0ff3e72a833e899
parent 474155 a42b86ea3a3b14ae7f90b587491227efb270d45a
child 474157 fe33adcc329269c15e486d32bcf472e96e647c63
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1387143
milestone62.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 1387143 part 4. Stop using nsISelection in remaining xpidl. r=mats
dom/base/nsPIDOMWindow.h
dom/events/EventStateManager.cpp
dom/events/EventStateManager.h
dom/interfaces/base/nsIDOMWindow.idl
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/nsIEditActionListener.idl
editor/nsIHTMLEditor.idl
editor/spellchecker/TextServicesDocument.cpp
editor/spellchecker/nsIInlineSpellChecker.idl
widget/nsBaseDragService.cpp
widget/nsIDragService.idl
--- a/dom/base/nsPIDOMWindow.h
+++ b/dom/base/nsPIDOMWindow.h
@@ -27,16 +27,17 @@ class nsGlobalWindowOuter;
 class nsIArray;
 class nsIContent;
 class nsICSSDeclaration;
 class nsIDocShell;
 class nsIDocShellLoadInfo;
 class nsIDocument;
 class nsIIdleObserver;
 class nsIPrincipal;
+class nsISelection;
 class nsIScriptTimeoutHandler;
 class nsISerialEventTarget;
 class nsIURI;
 class nsPIDOMWindowInner;
 class nsPIDOMWindowOuter;
 class nsPIWindowRoot;
 class nsXBLPrototypeHandler;
 
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -2107,17 +2107,17 @@ EventStateManager::DetermineDragTargetAn
   }
 }
 
 bool
 EventStateManager::DoDefaultDragStart(nsPresContext* aPresContext,
                                       WidgetDragEvent* aDragEvent,
                                       DataTransfer* aDataTransfer,
                                       nsIContent* aDragTarget,
-                                      nsISelection* aSelection,
+                                      Selection* aSelection,
                                       const nsACString& aPrincipalURISpec)
 {
   nsCOMPtr<nsIDragService> dragService =
     do_GetService("@mozilla.org/widget/dragservice;1");
   if (!dragService)
     return false;
 
   // Default handling for the dragstart event.
--- a/dom/events/EventStateManager.h
+++ b/dom/events/EventStateManager.h
@@ -1040,17 +1040,17 @@ protected:
    * aSelection - the selection to be dragged
    * aPrincipalURISpec - the URI of the triggering principal of the drag,
    *                     or an empty string if it's from browser chrome or OS
    */
   bool DoDefaultDragStart(nsPresContext* aPresContext,
                           WidgetDragEvent* aDragEvent,
                           dom::DataTransfer* aDataTransfer,
                           nsIContent* aDragTarget,
-                          nsISelection* aSelection,
+                          dom::Selection* aSelection,
                           const nsACString& aPrincipalURISpec);
 
   bool IsTrackingDragGesture ( ) const { return mGestureDownContent != nullptr; }
   /**
    * Set the fields of aEvent to reflect the mouse position and modifier keys
    * that were set when the user first pressed the mouse button (stored by
    * BeginTrackingDragGesture). aEvent->mWidget must be
    * mCurrentTarget->GetNearestWidget().
--- a/dom/interfaces/base/nsIDOMWindow.idl
+++ b/dom/interfaces/base/nsIDOMWindow.idl
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "domstubs.idl"
 
 interface nsIControllers;
 interface nsIDOMBlob;
 interface nsIDOMOfflineResourceList;
 interface nsIPrompt;
-interface nsISelection;
 interface nsIVariant;
 
 /**
  * Empty interface for compatibility with older versions.
  * @deprecated Use WebIDL for script visible features,
  *             nsPIDOMWindow for C++ callers.
  */
 
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -297,17 +297,17 @@ HTMLEditor::DeleteRefToAnonymousNode(Man
   // The ManualNACPtr destructor will invoke UnbindFromTree.
 }
 
 // The following method is mostly called by a selection listener. When a
 // selection change is notified, the method is called to check if resizing
 // handles, a grabber and/or inline table editing UI need to be displayed
 // or refreshed
 NS_IMETHODIMP
-HTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection* aSelection)
+HTMLEditor::CheckSelectionStateForAnonymousButtons(Selection* aSelection)
 {
   NS_ENSURE_ARG_POINTER(aSelection);
 
   // early way out if all contextual UI extensions are disabled
   NS_ENSURE_TRUE(mIsObjectResizingEnabled ||
       mIsAbsolutelyPositioningEnabled ||
       mIsInlineTableEditingEnabled, NS_OK);
 
--- a/editor/nsIEditActionListener.idl
+++ b/editor/nsIEditActionListener.idl
@@ -1,19 +1,18 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "domstubs.idl"
 
-interface nsISelection;
-
 webidl CharacterData;
+webidl Selection;
 
 /*
 Editor Action Listener interface to outside world
 */
 
 
 /**
  * A generic editor action listener interface.
@@ -111,16 +110,16 @@ interface nsIEditActionListener : nsISup
                      in long                aOffset,
                      in long                aLength,
                      in nsresult            aResult);
 
   /**
    * Called before the editor deletes the selection.
    * @param aSelection   The selection to be deleted
    */
-  void WillDeleteSelection(in nsISelection aSelection);
+  void WillDeleteSelection(in Selection aSelection);
 
   /**
    * Called after the editor deletes the selection.
    * @param aSelection   The selection, after deletion
    */
-  void DidDeleteSelection(in nsISelection aSelection);
+  void DidDeleteSelection(in Selection aSelection);
 };
--- a/editor/nsIHTMLEditor.idl
+++ b/editor/nsIHTMLEditor.idl
@@ -3,20 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "domstubs.idl"
 
 interface nsIContent;
 interface nsIArray;
-interface nsISelection;
 
 webidl Element;
 webidl Node;
+webidl Selection;
 
 [scriptable, builtinclass, uuid(87ee993e-985f-4a43-a974-0d9512da2fb0)]
 interface nsIHTMLEditor : nsISupports
 {
 %{C++
   typedef short EAlignment;
 %}
 
@@ -196,17 +196,17 @@ interface nsIHTMLEditor : nsISupports
    *   This should be done after the document URL has changed,
    *     such as after saving a file
    *   This is used as base for relativizing link and image urls
    */
   void updateBaseURL();
 
 
   /* ------------ Selection manipulation -------------- */
-  /* Should these be moved to nsISelection? */
+  /* Should these be moved to Selection? */
 
   /**
     * Set the selection at the suppled element
     *
     * @param aElement   An element in the document
     */
   void selectElement(in Element aElement);
 
@@ -449,17 +449,17 @@ interface nsIHTMLEditor : nsISupports
    */
   Element getSelectionContainer();
 
   /**
    * Checks if the anonymous nodes created by the HTML editor have to be
    * refreshed or hidden depending on a possible new state of the selection
    * @param aSelection [IN] a selection
    */
-  void checkSelectionStateForAnonymousButtons(in nsISelection aSelection);
+  void checkSelectionStateForAnonymousButtons(in Selection aSelection);
 
   boolean isAnonymousElement(in Element aElement);
 
   /**
    * A boolean indicating if a return key pressed in a paragraph creates
    * another paragraph or just inserts a <br> at the caret
    *
    * @return    true if CR in a paragraph creates a new paragraph
--- a/editor/spellchecker/TextServicesDocument.cpp
+++ b/editor/spellchecker/TextServicesDocument.cpp
@@ -3230,20 +3230,20 @@ TextServicesDocument::DidDeleteText(Char
                                     int32_t aOffset,
                                     int32_t aLength,
                                     nsresult aResult)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TextServicesDocument::WillDeleteSelection(nsISelection* aSelection)
+TextServicesDocument::WillDeleteSelection(Selection* aSelection)
 {
   return NS_OK;
 }
 
 NS_IMETHODIMP
-TextServicesDocument::DidDeleteSelection(nsISelection* aSelection)
+TextServicesDocument::DidDeleteSelection(Selection* aSelection)
 {
   return NS_OK;
 }
 
 } // namespace mozilla
--- a/editor/spellchecker/nsIInlineSpellChecker.idl
+++ b/editor/spellchecker/nsIInlineSpellChecker.idl
@@ -1,17 +1,16 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "domstubs.idl"
 
-interface nsISelection;
 interface nsIEditor;
 interface nsIEditorSpellCheck;
 
 [scriptable, uuid(b7b7a77c-40c4-4196-b0b7-b0338243b3fe)]
 interface nsIInlineSpellChecker : nsISupports
 {
   readonly attribute nsIEditorSpellCheck spellChecker;
 
--- a/widget/nsBaseDragService.cpp
+++ b/widget/nsBaseDragService.cpp
@@ -308,29 +308,29 @@ nsBaseDragService::InvokeDragSessionWith
     mHasImage = false;
     mDataTransfer = nullptr;
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsBaseDragService::InvokeDragSessionWithSelection(nsISelection* aSelection,
+nsBaseDragService::InvokeDragSessionWithSelection(Selection* aSelection,
                                                   const nsACString& aPrincipalURISpec,
                                                   nsIArray* aTransferableArray,
                                                   uint32_t aActionType,
                                                   DragEvent* aDragEvent,
                                                   DataTransfer* aDataTransfer)
 {
   NS_ENSURE_TRUE(aSelection, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(aDragEvent, NS_ERROR_NULL_POINTER);
   NS_ENSURE_TRUE(mSuppressLevel == 0, NS_ERROR_FAILURE);
 
   mDataTransfer = aDataTransfer;
-  mSelection = aSelection ? aSelection->AsSelection() : nullptr;
+  mSelection = aSelection;
   mHasImage = true;
   mDragPopup = nullptr;
   mImage = nullptr;
   mImageOffset = CSSIntPoint();
 
   mScreenPosition.x = aDragEvent->ScreenX(CallerType::System);
   mScreenPosition.y = aDragEvent->ScreenY(CallerType::System);
   mInputSource = aDragEvent->MozInputSource();
--- a/widget/nsIDragService.idl
+++ b/widget/nsIDragService.idl
@@ -6,19 +6,19 @@
 
 #include "nsIArray.idl"
 #include "nsISupports.idl"
 #include "nsIDragSession.idl"
 #include "nsIScriptableRegion.idl"
 #include "nsIContentPolicy.idl"
 
 interface nsIDOMNode;
-interface nsISelection;
 
 webidl DragEvent;
+webidl Selection;
 
 %{C++
 #include "mozilla/EventForwards.h"
 
 namespace mozilla {
 namespace dom {
 class ContentParent;
 class DataTransfer;
@@ -102,17 +102,17 @@ interface nsIDragService : nsISupports
 
   /**
    * Start a modal drag session using the selection as the drag image.
    * The aDragEvent must be supplied as the current screen coordinates of the
    * event are needed to calculate the image location.
    *
    * Note: This method is deprecated for non-native code.
    */
-  void invokeDragSessionWithSelection(in nsISelection aSelection,
+  void invokeDragSessionWithSelection(in Selection aSelection,
                                       in AUTF8String aPrincipalURISpec,
                                       in nsIArray aTransferableArray,
                                       in unsigned long aActionType,
                                       in DragEvent aDragEvent,
                                       in DataTransferPtr aDataTransfer);
 
   /**
     * Returns the current Drag Session