From 7fe6dda3aae5081c28e3c31324cd1df5412fceea Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 May 2018 13:52:38 -0400 Subject: [PATCH] Bug 1387143 part 15. Remove nsISelectionPrivate::Get/SetSelectionDirection. r=mats --- dom/base/Selection.cpp | 10 ---------- dom/base/nsISelectionPrivate.idl | 6 ------ dom/html/nsTextEditorState.cpp | 2 +- layout/forms/nsTextControlFrame.cpp | 7 ++----- 4 files changed, 3 insertions(+), 22 deletions(-) diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index af4b515a4d26..3e5a30165c23 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -4119,16 +4119,6 @@ Selection::ResetColors(ErrorResult& aRv) mCustomColors = nullptr; } -NS_IMETHODIMP_(nsDirection) -Selection::GetSelectionDirection() { - return mDirection; -} - -NS_IMETHODIMP_(void) -Selection::SetSelectionDirection(nsDirection aDirection) { - mDirection = aDirection; -} - JSObject* Selection::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { diff --git a/dom/base/nsISelectionPrivate.idl b/dom/base/nsISelectionPrivate.idl index d8dcfbdb3663..b9d4468dfa8b 100644 --- a/dom/base/nsISelectionPrivate.idl +++ b/dom/base/nsISelectionPrivate.idl @@ -31,12 +31,6 @@ native ScrollAxis(nsIPresShell::ScrollAxis); [uuid(0c9f4f74-ee7e-4fe9-be6b-0ba856368178)] interface nsISelectionPrivate : nsISupports { - /** - * Get the direction of the selection. - */ - [noscript, notxpcom] nsDirection getSelectionDirection(); - [noscript, notxpcom] void setSelectionDirection(in nsDirection aDirection); - /** * Returns the type of the selection (see nsISelectionController for * available constants). diff --git a/dom/html/nsTextEditorState.cpp b/dom/html/nsTextEditorState.cpp index a83cddd51fc2..382d149f98f7 100644 --- a/dom/html/nsTextEditorState.cpp +++ b/dom/html/nsTextEditorState.cpp @@ -1662,7 +1662,7 @@ nsTextEditorState::GetSelectionDirection(ErrorResult& aRv) return nsITextControlFrame::eForward; // Doesn't really matter } - nsDirection direction = sel->GetSelectionDirection(); + nsDirection direction = sel->GetDirection(); if (direction == eDirNext) { return nsITextControlFrame::eForward; } diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index b6ed611629d1..c078fc70b5ac 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -887,13 +887,10 @@ nsTextControlFrame::SetSelectionInternal(nsINode* aStartNode, selCon->GetSelection(nsISelectionController::SELECTION_NORMAL); NS_ENSURE_TRUE(selection, NS_ERROR_FAILURE); - nsCOMPtr selPriv = do_QueryObject(selection, &rv); - NS_ENSURE_SUCCESS(rv, rv); - nsDirection direction; if (aDirection == eNone) { // Preserve the direction - direction = selPriv->GetSelectionDirection(); + direction = selection->GetDirection(); } else { direction = (aDirection == eBackward) ? eDirPrevious : eDirNext; } @@ -909,7 +906,7 @@ nsTextControlFrame::SetSelectionInternal(nsINode* aStartNode, return err.StealNSResult(); } - selPriv->SetSelectionDirection(direction); + selection->SetDirection(direction); return rv; }