diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index ee5fcb91fd23..ce1c37d8aa71 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -762,9 +762,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Selection) // QueryInterface implementation for Selection NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Selection) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY - NS_INTERFACE_MAP_ENTRY(nsISelection) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsISelection) + NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END NS_IMPL_MAIN_THREAD_ONLY_CYCLE_COLLECTING_ADDREF(Selection) diff --git a/dom/base/Selection.h b/dom/base/Selection.h index 55210308b4ef..2416fbc39542 100644 --- a/dom/base/Selection.h +++ b/dom/base/Selection.h @@ -16,7 +16,6 @@ #include "mozilla/WeakPtr.h" #include "nsDirection.h" #include "nsIPresShell.h" // For ScrollAxis -#include "nsISelection.h" #include "nsISelectionController.h" #include "nsISelectionListener.h" #include "nsRange.h" @@ -64,9 +63,8 @@ namespace dom { // addreffing/releasing the Selection object is aggregated to nsFrameSelection. // Otherwise normal addref/release is used. This ensures that nsFrameSelection // is never deleted before its Selections. -class Selection final : public nsISelection, +class Selection final : public nsSupportsWeakReference, public nsWrapperCache, - public nsSupportsWeakReference, public SupportsWeakPtr { protected: @@ -79,8 +77,7 @@ public: MOZ_DECLARE_WEAKREFERENCE_TYPENAME(Selection) NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Selection, nsISelection) - NS_DECL_NSISELECTION + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Selection) // match this up with EndbatchChanges. will stop ui updates while multiple // selection methods are called diff --git a/dom/base/moz.build b/dom/base/moz.build index 47c92071b584..652359a3e64d 100644 --- a/dom/base/moz.build +++ b/dom/base/moz.build @@ -25,7 +25,6 @@ XPIDL_SOURCES += [ 'nsIPerformanceMetrics.idl', 'nsIRemoteWindowContext.idl', 'nsIScriptChannel.idl', - 'nsISelection.idl', 'nsISelectionController.idl', 'nsISelectionDisplay.idl', 'nsISelectionListener.idl', diff --git a/dom/base/nsCopySupport.h b/dom/base/nsCopySupport.h index dcaa72d84dcc..d87e53bcce4c 100644 --- a/dom/base/nsCopySupport.h +++ b/dom/base/nsCopySupport.h @@ -12,7 +12,6 @@ #include "mozilla/EventForwards.h" class nsINode; -class nsISelection; class nsIDocument; class nsIImageLoadingContent; class nsIContent; diff --git a/dom/base/nsGlobalWindowInner.cpp b/dom/base/nsGlobalWindowInner.cpp index e1887b473911..cb043a04d979 100644 --- a/dom/base/nsGlobalWindowInner.cpp +++ b/dom/base/nsGlobalWindowInner.cpp @@ -121,7 +121,6 @@ #include "nsView.h" #include "nsViewManager.h" #include "nsISelectionController.h" -#include "nsISelection.h" #include "nsIPrompt.h" #include "nsIPromptService.h" #include "nsIPromptFactory.h" @@ -4432,7 +4431,7 @@ nsGlobalWindowInner::ConvertDialogOptions(const nsAString& aOptions, void nsGlobalWindowInner::UpdateCommands(const nsAString& anAction, - nsISelection* aSel, + Selection* aSel, int16_t aReason) { if (GetOuterWindowInternal()) { diff --git a/dom/base/nsGlobalWindowInner.h b/dom/base/nsGlobalWindowInner.h index e4081868cdf4..75b6ebac2918 100644 --- a/dom/base/nsGlobalWindowInner.h +++ b/dom/base/nsGlobalWindowInner.h @@ -897,7 +897,8 @@ public: const nsAString& aOptions, const mozilla::dom::Sequence& aExtraArgument, mozilla::ErrorResult& aError); - void UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason); + void UpdateCommands(const nsAString& anAction, mozilla::dom::Selection* aSel, + int16_t aReason); void GetContent(JSContext* aCx, JS::MutableHandle aRetval, diff --git a/dom/base/nsGlobalWindowOuter.cpp b/dom/base/nsGlobalWindowOuter.cpp index 4db07708552e..f33ec565b3d4 100644 --- a/dom/base/nsGlobalWindowOuter.cpp +++ b/dom/base/nsGlobalWindowOuter.cpp @@ -118,7 +118,6 @@ #include "nsView.h" #include "nsViewManager.h" #include "nsISelectionController.h" -#include "nsISelection.h" #include "nsIPrompt.h" #include "nsIPromptService.h" #include "nsIPromptFactory.h" @@ -6275,7 +6274,7 @@ public: void nsGlobalWindowOuter::UpdateCommands(const nsAString& anAction, - nsISelection* aSel, + Selection* aSel, int16_t aReason) { // If this is a child process, redirect to the parent process. diff --git a/dom/base/nsGlobalWindowOuter.h b/dom/base/nsGlobalWindowOuter.h index fb47798c10db..228e932b8bbc 100644 --- a/dom/base/nsGlobalWindowOuter.h +++ b/dom/base/nsGlobalWindowOuter.h @@ -692,7 +692,8 @@ public: const nsAString& aOptions, nsISupports* aExtraArgument, nsPIDOMWindowOuter** _retval) override; - void UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) override; + void UpdateCommands(const nsAString& anAction, mozilla::dom::Selection* aSel, + int16_t aReason) override; already_AddRefed GetContentInternal(mozilla::ErrorResult& aError, diff --git a/dom/base/nsISelection.idl b/dom/base/nsISelection.idl deleted file mode 100644 index 84440ae25639..000000000000 --- a/dom/base/nsISelection.idl +++ /dev/null @@ -1,31 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* 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" - -/* THIS IS A PUBLIC INTERFACE */ - -interface nsIDOMNode; -interface nsINode; - -%{C++ -namespace mozilla { -namespace dom { -class Selection; -} // namespace dom -} // namespace mozilla -%} - -/** - * Interface for manipulating and querying the current selected range - * of nodes within the document. - * - * @version 1.0 - */ - -[shim(Selection), uuid(e0a4d4b3-f34e-44bd-b1f2-4e3bde9b6915)] -interface nsISelection : nsISupports -{ -}; diff --git a/dom/base/nsPIDOMWindow.h b/dom/base/nsPIDOMWindow.h index 389801c6ba60..0a1102786cd1 100644 --- a/dom/base/nsPIDOMWindow.h +++ b/dom/base/nsPIDOMWindow.h @@ -32,7 +32,6 @@ class nsIDocShellLoadInfo; class nsIDocument; class nsIIdleObserver; class nsIPrincipal; -class nsISelection; class nsIScriptTimeoutHandler; class nsISerialEventTarget; class nsIURI; @@ -1120,7 +1119,9 @@ public: virtual nsresult MoveBy(int32_t aXDif, int32_t aYDif) = 0; - virtual void UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) = 0; + virtual void UpdateCommands(const nsAString& anAction, + mozilla::dom::Selection* aSel, + int16_t aReason) = 0; mozilla::dom::DocGroup* GetDocGroup() const; virtual nsISerialEventTarget* diff --git a/dom/events/IMEContentObserver.h b/dom/events/IMEContentObserver.h index 1852f268b475..b0d697bf5433 100644 --- a/dom/events/IMEContentObserver.h +++ b/dom/events/IMEContentObserver.h @@ -23,7 +23,6 @@ class nsIContent; class nsINode; -class nsISelection; class nsPresContext; namespace mozilla { diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp index 105b69267ed6..fc0d59e2b332 100644 --- a/dom/events/IMEStateManager.cpp +++ b/dom/events/IMEStateManager.cpp @@ -34,7 +34,6 @@ #include "nsINode.h" #include "nsIObserverService.h" #include "nsIPresShell.h" -#include "nsISelection.h" #include "nsISupports.h" #include "nsPresContext.h" diff --git a/dom/events/IMEStateManager.h b/dom/events/IMEStateManager.h index a39fb2295bd1..1d2bd99586b4 100644 --- a/dom/events/IMEStateManager.h +++ b/dom/events/IMEStateManager.h @@ -15,7 +15,6 @@ class nsIContent; class nsINode; class nsPresContext; -class nsISelection; namespace mozilla { diff --git a/dom/html/TextInputListener.h b/dom/html/TextInputListener.h index 8681684bd6d7..b043b82a3d41 100644 --- a/dom/html/TextInputListener.h +++ b/dom/html/TextInputListener.h @@ -13,12 +13,15 @@ #include "nsWeakReference.h" class nsIFrame; -class nsISelection; class nsITextControlElement; class nsTextControlFrame; namespace mozilla { +namespace dom { +class Selection; +} // namespace dom + class TextInputListener final : public nsIDOMEventListener , public nsSupportsWeakReference { @@ -75,7 +78,7 @@ protected: virtual ~TextInputListener() = default; nsresult UpdateTextInputCommands(const nsAString& aCommandsToUpdate, - nsISelection* aSelection = nullptr, + dom::Selection* aSelection = nullptr, int16_t aReason = 0); protected: diff --git a/dom/html/nsTextEditorState.cpp b/dom/html/nsTextEditorState.cpp index f93826c9864b..a0e61c588c96 100644 --- a/dom/html/nsTextEditorState.cpp +++ b/dom/html/nsTextEditorState.cpp @@ -1029,7 +1029,7 @@ TextInputListener::HandleValueChanged(nsTextControlFrame* aFrame) nsresult TextInputListener::UpdateTextInputCommands(const nsAString& aCommandsToUpdate, - nsISelection* aSelection, + Selection* aSelection, int16_t aReason) { nsIContent* content = mFrame->GetContent(); diff --git a/editor/composer/ComposerCommandsUpdater.cpp b/editor/composer/ComposerCommandsUpdater.cpp index 4a8f74305880..974225bb1f27 100644 --- a/editor/composer/ComposerCommandsUpdater.cpp +++ b/editor/composer/ComposerCommandsUpdater.cpp @@ -18,7 +18,6 @@ #include "nsIDOMWindow.h" // for nsIDOMWindow #include "nsIDocShell.h" // for nsIDocShell #include "nsIInterfaceRequestorUtils.h" // for do_GetInterface -#include "nsISelection.h" // for nsISelection #include "nsITransactionManager.h" // for nsITransactionManager #include "nsLiteralString.h" // for NS_LITERAL_STRING #include "nsPICommandUpdater.h" // for nsPICommandUpdater diff --git a/editor/composer/nsEditingSession.cpp b/editor/composer/nsEditingSession.cpp index daff8036bd71..03212a758560 100644 --- a/editor/composer/nsEditingSession.cpp +++ b/editor/composer/nsEditingSession.cpp @@ -36,7 +36,6 @@ #include "nsIPresShell.h" // for nsIPresShell #include "nsIRefreshURI.h" // for nsIRefreshURI #include "nsIRequest.h" // for nsIRequest -#include "nsISelection.h" // for nsISelection #include "nsITimer.h" // for nsITimer, etc #include "nsITransactionManager.h" // for nsITransactionManager #include "nsIWeakReference.h" // for nsISupportsWeakReference, etc diff --git a/editor/libeditor/HTMLAnonymousNodeEditor.cpp b/editor/libeditor/HTMLAnonymousNodeEditor.cpp index a1fce16e6b53..643b8bd99fa6 100644 --- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp +++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp @@ -41,7 +41,6 @@ #include "nsROCSSPrimitiveValue.h" class nsIDOMEventListener; -class nsISelection; namespace mozilla { diff --git a/editor/libeditor/HTMLEditor.h b/editor/libeditor/HTMLEditor.h index b64896ad7a35..48aa9f6de45d 100644 --- a/editor/libeditor/HTMLEditor.h +++ b/editor/libeditor/HTMLEditor.h @@ -43,7 +43,6 @@ class nsILinkHandler; class nsTableWrapperFrame; class nsIDOMRange; class nsRange; -class nsISelection; namespace mozilla { class AutoSelectionSetterAfterTableEdit; diff --git a/editor/libeditor/HTMLEditorObjectResizer.cpp b/editor/libeditor/HTMLEditorObjectResizer.cpp index 610f7b2a62d3..907b051629a1 100644 --- a/editor/libeditor/HTMLEditorObjectResizer.cpp +++ b/editor/libeditor/HTMLEditorObjectResizer.cpp @@ -35,8 +35,6 @@ #include "nscore.h" #include -class nsISelection; - namespace mozilla { using namespace dom; diff --git a/editor/spellchecker/TextServicesDocument.h b/editor/spellchecker/TextServicesDocument.h index acc159e619a1..b59378840b85 100644 --- a/editor/spellchecker/TextServicesDocument.h +++ b/editor/spellchecker/TextServicesDocument.h @@ -19,7 +19,6 @@ class nsIContentIterator; class nsIDOMNode; class nsIEditor; class nsINode; -class nsISelection; class nsISelectionController; class nsITextServicesFilter; class nsRange; diff --git a/extensions/spellcheck/src/mozInlineSpellChecker.cpp b/extensions/spellcheck/src/mozInlineSpellChecker.cpp index dc052c528ad8..b5278fde4259 100644 --- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp +++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp @@ -56,7 +56,6 @@ #include "nsIPrefBranch.h" #include "nsIPrefService.h" #include "nsIRunnable.h" -#include "nsISelection.h" #include "nsISelectionController.h" #include "nsIServiceManager.h" #include "nsITextServicesFilter.h" diff --git a/layout/base/nsCaret.h b/layout/base/nsCaret.h index e61ae16c1960..5ed255a9f80f 100644 --- a/layout/base/nsCaret.h +++ b/layout/base/nsCaret.h @@ -75,7 +75,7 @@ class nsCaret final : public nsISelectionListener * It does not take account of blinking or the caret being hidden * because we're in non-editable/disabled content. */ - bool IsVisible(nsISelection* aSelection = nullptr) + bool IsVisible(mozilla::dom::Selection* aSelection = nullptr) { if (!mVisible || mHideCount) { return false; @@ -84,7 +84,7 @@ class nsCaret final : public nsISelectionListener if (!mShowDuringSelection) { mozilla::dom::Selection* selection; if (aSelection) { - selection = static_cast(aSelection); + selection = aSelection; } else { selection = GetSelection(); } diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index e136590c6bcb..f09a058dca05 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -65,7 +65,6 @@ class nsILayoutHistoryState; class nsIReflowCallback; class nsIDOMNode; class nsCSSFrameConstructor; -class nsISelection; template class nsCOMArray; class AutoWeakFrame; class WeakFrame; diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index c078fc70b5ac..ba0060b2d6ca 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -774,7 +774,7 @@ void nsTextControlFrame::SetFocus(bool aOn, bool aRepaint) } // Scroll the current selection into view - nsISelection *caretSelection = caret->GetSelection(); + Selection* caretSelection = caret->GetSelection(); const bool isFocusedRightNow = ourSel == caretSelection; if (!isFocusedRightNow) { // Don't scroll the current selection if we've been focused using the mouse. diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp index c5c9d5d6ec3e..bcdf13b11a10 100644 --- a/layout/generic/nsFrameSelection.cpp +++ b/layout/generic/nsFrameSelection.cpp @@ -2936,7 +2936,7 @@ NS_IMPL_ISUPPORTS(nsAutoCopyListener, nsISelectionListener) * What we should do, to make our end of the deal faster: * Create a singleton transferable with our own magic converter. When selection * changes (use a quick cache to detect ``real'' changes), we put the new - * nsISelection in the transferable. Our magic converter will take care of + * Selection in the transferable. Our magic converter will take care of * transferable->whatever-other-format when the time comes to actually * hand over the clipboard contents. * diff --git a/mobile/android/modules/ActionBarHandler.jsm b/mobile/android/modules/ActionBarHandler.jsm index 1a02029735a2..9c5141b57178 100644 --- a/mobile/android/modules/ActionBarHandler.jsm +++ b/mobile/android/modules/ActionBarHandler.jsm @@ -757,7 +757,7 @@ var ActionBarHandler = { }, /** - * Provides the nsISelection for either an editor, or from the + * Provides the Selection for either an editor, or from the * default window. */ _getSelection: function(element = this._targetElement, win = this._contentWindow) { diff --git a/toolkit/components/find/nsFind.cpp b/toolkit/components/find/nsFind.cpp index efbe9b1fcf87..fba275210b21 100644 --- a/toolkit/components/find/nsFind.cpp +++ b/toolkit/components/find/nsFind.cpp @@ -10,7 +10,6 @@ #include "nsContentCID.h" #include "nsIContent.h" #include "nsIDOMNode.h" -#include "nsISelection.h" #include "nsISelectionController.h" #include "nsIFrame.h" #include "nsITextControlFrame.h" diff --git a/toolkit/components/typeaheadfind/nsTypeAheadFind.h b/toolkit/components/typeaheadfind/nsTypeAheadFind.h index ce8696b1b3c5..c45c155e58e4 100644 --- a/toolkit/components/typeaheadfind/nsTypeAheadFind.h +++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.h @@ -13,7 +13,6 @@ #include "nsIFind.h" #include "nsIWebBrowserFind.h" #include "nsWeakReference.h" -#include "nsISelection.h" #include "nsIDOMRange.h" #include "nsIDocShellTreeItem.h" #include "nsITypeAheadFind.h" diff --git a/widget/android/GeckoEditableSupport.cpp b/widget/android/GeckoEditableSupport.cpp index 3424f0aa25a1..55e0987face4 100644 --- a/widget/android/GeckoEditableSupport.cpp +++ b/widget/android/GeckoEditableSupport.cpp @@ -10,7 +10,6 @@ #include "KeyEvent.h" #include "PuppetWidget.h" #include "nsIContent.h" -#include "nsISelection.h" #include "mozilla/IMEStateManager.h" #include "mozilla/Preferences.h" diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index 7a6ad8616b40..72ea10cf3c99 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -34,7 +34,6 @@ #include "nsPresContext.h" #include "nsIContent.h" #include "nsIDocument.h" -#include "nsISelection.h" #include "nsViewManager.h" #include "nsIFrame.h" #include "nsGtkUtils.h"