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 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'dom/html/nsHTMLDocument.cpp') 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() { -- cgit v1.2.3