From 5453e2995c2ed8776710baf14646c19a13b5f205 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 8 May 2018 13:52:38 -0400 Subject: [PATCH] Bug 1387143 part 16. Remove nsISelectionPrivate::GetType. r=mats --- accessible/base/Logging.cpp | 14 ++++++-------- accessible/base/Logging.h | 8 ++++++-- dom/base/Selection.cpp | 8 -------- dom/base/nsISelectionPrivate.idl | 6 ------ 4 files changed, 12 insertions(+), 24 deletions(-) diff --git a/accessible/base/Logging.cpp b/accessible/base/Logging.cpp index 8c96f6d30dca..922d5e7113c4 100644 --- a/accessible/base/Logging.cpp +++ b/accessible/base/Logging.cpp @@ -16,7 +16,7 @@ #include "nsDocShellLoadTypes.h" #include "nsIChannel.h" #include "nsIInterfaceRequestorUtils.h" -#include "nsISelectionPrivate.h" +#include "nsISelectionController.h" #include "nsTraceRefcnt.h" #include "nsIWebProgress.h" #include "prenv.h" @@ -24,6 +24,7 @@ #include "nsIURI.h" #include "mozilla/dom/Element.h" #include "mozilla/dom/HTMLBodyElement.h" +#include "mozilla/dom/Selection.h" using namespace mozilla; using namespace mozilla::a11y; @@ -590,18 +591,15 @@ logging::FocusDispatched(Accessible* aTarget) } void -logging::SelChange(nsISelection* aSelection, DocAccessible* aDocument, +logging::SelChange(dom::Selection* aSelection, DocAccessible* aDocument, int16_t aReason) { - nsCOMPtr privSel(do_QueryInterface(aSelection)); - - int16_t type = 0; - privSel->GetType(&type); + SelectionType type = aSelection->GetType(); const char* strType = 0; - if (type == nsISelectionController::SELECTION_NORMAL) + if (type == SelectionType::eNormal) strType = "normal"; - else if (type == nsISelectionController::SELECTION_SPELLCHECK) + else if (type == SelectionType::eSpellCheck) strType = "spellcheck"; else strType = "unknown"; diff --git a/accessible/base/Logging.h b/accessible/base/Logging.h index aa102b742f2f..98c150f72dfe 100644 --- a/accessible/base/Logging.h +++ b/accessible/base/Logging.h @@ -14,11 +14,15 @@ class nsIDocument; class nsINode; class nsIRequest; -class nsISelection; class nsISupports; class nsIWebProgress; namespace mozilla { + +namespace dom { +class Selection; +} // namespace dom + namespace a11y { class AccEvent; @@ -128,7 +132,7 @@ void FocusDispatched(Accessible* aTarget); /** * Log the selection change. */ -void SelChange(nsISelection* aSelection, DocAccessible* aDocument, +void SelChange(dom::Selection* aSelection, DocAccessible* aDocument, int16_t aReason); /** diff --git a/dom/base/Selection.cpp b/dom/base/Selection.cpp index 3e5a30165c23..619aa434d14e 100644 --- a/dom/base/Selection.cpp +++ b/dom/base/Selection.cpp @@ -1295,14 +1295,6 @@ Selection::Clear(nsPresContext* aPresContext) return NS_OK; } -NS_IMETHODIMP -Selection::GetType(int16_t* aType) -{ - NS_ENSURE_ARG_POINTER(aType); - *aType = ToRawSelectionType(Type()); - return NS_OK; -} - // RangeMatches*Point // // Compares the range beginning or ending point, and returns true if it diff --git a/dom/base/nsISelectionPrivate.idl b/dom/base/nsISelectionPrivate.idl index b9d4468dfa8b..a9efb68c7b95 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 { - /** - * Returns the type of the selection (see nsISelectionController for - * available constants). - */ - readonly attribute short type; - /** * Return array of ranges intersecting with the given DOM interval. */