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

@ -12846,3 +12846,19 @@ nsDocument::CheckCustomElementName(const ElementCreationOptions& aOptions,
return is;
}
Selection*
nsIDocument::GetSelection(ErrorResult& aRv)
{
nsCOMPtr<nsPIDOMWindowInner> window = GetInnerWindow();
if (!window) {
return nullptr;
}
NS_ASSERTION(window->IsInnerWindow(), "Should have inner window here!");
if (!window->IsCurrentInnerWindow()) {
return nullptr;
}
return nsGlobalWindow::Cast(window)->GetSelection(aRv);
}

View file

@ -151,6 +151,7 @@ class NodeIterator;
enum class OrientationType : uint32_t;
class ProcessingInstruction;
class Promise;
class Selection;
class StyleSheetList;
class SVGDocument;
class SVGSVGElement;
@ -898,6 +899,8 @@ public:
*/
Element* GetRootElement() const;
mozilla::dom::Selection* GetSelection(mozilla::ErrorResult& aRv);
/**
* Retrieve information about the viewport as a data structure.
* This will return information in the viewport META data section