diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-04-23 11:45:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-23 11:45:04 +0200 |
commit | 3b55277bc59d6bea5f61c164f9687ae242b88550 (patch) | |
tree | 1e0a3ca438adc705be3618808e71bb6aa5f1e330 /dom/html/nsHTMLDocument.cpp | |
parent | d220a5e6aaa7410b8c62fd3f7f37e8fb853e5797 (diff) | |
parent | 0a9acadccafe04aa5bc3335523bb55fe52ca8e50 (diff) | |
download | UXP-3b55277bc59d6bea5f61c164f9687ae242b88550.tar UXP-3b55277bc59d6bea5f61c164f9687ae242b88550.tar.gz UXP-3b55277bc59d6bea5f61c164f9687ae242b88550.tar.lz UXP-3b55277bc59d6bea5f61c164f9687ae242b88550.tar.xz UXP-3b55277bc59d6bea5f61c164f9687ae242b88550.zip |
Merge pull request #237 from janekptacijarabaci/js_dom_getSelection_document_1
moebius#121: DOM - Selection API - getSelection() should exist on XMLDocument / Selection.type
Diffstat (limited to 'dom/html/nsHTMLDocument.cpp')
-rw-r--r-- | dom/html/nsHTMLDocument.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
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<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() { |