moebius#121: DOM - Selection API - getSelection() should exist on XMLDocument / Selection.type

https://github.com/MoonchildProductions/moebius/pull/121
This commit is contained in:
janekptacijarabaci 2018-04-23 09:16:50 +02:00 committed by Roy Tam
commit 9db39c42c0
10 changed files with 43 additions and 32 deletions

View file

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