Bug 1387143 part 29. Remove nsISelection. r=mats

This commit is contained in:
Boris Zbarsky 2018-05-08 13:52:42 -04:00
parent a44e6132ff
commit 1fb03996f4
31 changed files with 23 additions and 72 deletions

View File

@ -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)

View File

@ -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<Selection>
{
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

View File

@ -25,7 +25,6 @@ XPIDL_SOURCES += [
'nsIPerformanceMetrics.idl',
'nsIRemoteWindowContext.idl',
'nsIScriptChannel.idl',
'nsISelection.idl',
'nsISelectionController.idl',
'nsISelectionDisplay.idl',
'nsISelectionListener.idl',

View File

@ -12,7 +12,6 @@
#include "mozilla/EventForwards.h"
class nsINode;
class nsISelection;
class nsIDocument;
class nsIImageLoadingContent;
class nsIContent;

View File

@ -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()) {

View File

@ -897,7 +897,8 @@ public:
const nsAString& aOptions,
const mozilla::dom::Sequence<JS::Value>& 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<JSObject*> aRetval,

View File

@ -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.

View File

@ -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<nsPIDOMWindowOuter>
GetContentInternal(mozilla::ErrorResult& aError,

View File

@ -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
{
};

View File

@ -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*

View File

@ -23,7 +23,6 @@
class nsIContent;
class nsINode;
class nsISelection;
class nsPresContext;
namespace mozilla {

View File

@ -34,7 +34,6 @@
#include "nsINode.h"
#include "nsIObserverService.h"
#include "nsIPresShell.h"
#include "nsISelection.h"
#include "nsISupports.h"
#include "nsPresContext.h"

View File

@ -15,7 +15,6 @@
class nsIContent;
class nsINode;
class nsPresContext;
class nsISelection;
namespace mozilla {

View File

@ -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:

View File

@ -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();

View File

@ -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

View File

@ -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

View File

@ -41,7 +41,6 @@
#include "nsROCSSPrimitiveValue.h"
class nsIDOMEventListener;
class nsISelection;
namespace mozilla {

View File

@ -43,7 +43,6 @@ class nsILinkHandler;
class nsTableWrapperFrame;
class nsIDOMRange;
class nsRange;
class nsISelection;
namespace mozilla {
class AutoSelectionSetterAfterTableEdit;

View File

@ -35,8 +35,6 @@
#include "nscore.h"
#include <algorithm>
class nsISelection;
namespace mozilla {
using namespace dom;

View File

@ -19,7 +19,6 @@ class nsIContentIterator;
class nsIDOMNode;
class nsIEditor;
class nsINode;
class nsISelection;
class nsISelectionController;
class nsITextServicesFilter;
class nsRange;

View File

@ -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"

View File

@ -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<mozilla::dom::Selection*>(aSelection);
selection = aSelection;
} else {
selection = GetSelection();
}

View File

@ -65,7 +65,6 @@ class nsILayoutHistoryState;
class nsIReflowCallback;
class nsIDOMNode;
class nsCSSFrameConstructor;
class nsISelection;
template<class E> class nsCOMArray;
class AutoWeakFrame;
class WeakFrame;

View File

@ -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.

View File

@ -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.
*

View File

@ -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) {

View File

@ -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"

View File

@ -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"

View File

@ -10,7 +10,6 @@
#include "KeyEvent.h"
#include "PuppetWidget.h"
#include "nsIContent.h"
#include "nsISelection.h"
#include "mozilla/IMEStateManager.h"
#include "mozilla/Preferences.h"

View File

@ -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"