From 0a9acadccafe04aa5bc3335523bb55fe52ca8e50 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Mon, 23 Apr 2018 09:16:50 +0200 Subject: moebius#121: DOM - Selection API - getSelection() should exist on XMLDocument / Selection.type https://github.com/MoonchildProductions/moebius/pull/121 --- dom/html/nsHTMLDocument.cpp | 18 +----------------- dom/html/nsHTMLDocument.h | 1 - 2 files changed, 1 insertion(+), 18 deletions(-) (limited to 'dom/html') diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index be5a34d41..69e710242 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -2149,26 +2149,10 @@ NS_IMETHODIMP nsHTMLDocument::GetSelection(nsISelection** aReturn) { ErrorResult rv; - NS_IF_ADDREF(*aReturn = GetSelection(rv)); + NS_IF_ADDREF(*aReturn = nsDocument::GetSelection(rv)); return rv.StealNSResult(); } -Selection* -nsHTMLDocument::GetSelection(ErrorResult& aRv) -{ - nsCOMPtr window = do_QueryInterface(GetScopeObject()); - if (!window) { - return nullptr; - } - - NS_ASSERTION(window->IsInnerWindow(), "Should have inner window here!"); - if (!window->IsCurrentInnerWindow()) { - return nullptr; - } - - return nsGlobalWindow::Cast(window)->GetSelection(aRv); -} - NS_IMETHODIMP nsHTMLDocument::CaptureEvents() { diff --git a/dom/html/nsHTMLDocument.h b/dom/html/nsHTMLDocument.h index 426ebddc5..1fa81f6cd 100644 --- a/dom/html/nsHTMLDocument.h +++ b/dom/html/nsHTMLDocument.h @@ -242,7 +242,6 @@ public: { // Deprecated } - mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aRv); // The XPCOM CaptureEvents works fine for us. // The XPCOM ReleaseEvents works fine for us. // We're picking up GetLocation from Document -- cgit v1.2.3