diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-06-13 08:23:21 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-06-13 08:23:21 -0400 |
commit | 5e7917e2c8bd50754535652014c1de0054841912 (patch) | |
tree | ead6813f00c5ff538adad2b2aa8406732ffeb2b4 /dom/base/nsDocument.cpp | |
parent | 43725c7264ca3f63de348d1d1596ce1fe9e64d2d (diff) | |
download | UXP-5e7917e2c8bd50754535652014c1de0054841912.tar UXP-5e7917e2c8bd50754535652014c1de0054841912.tar.gz UXP-5e7917e2c8bd50754535652014c1de0054841912.tar.lz UXP-5e7917e2c8bd50754535652014c1de0054841912.tar.xz UXP-5e7917e2c8bd50754535652014c1de0054841912.zip |
Bug 1429656 - Implement ShadowRoot.activeElement
Tag #1375
Diffstat (limited to 'dom/base/nsDocument.cpp')
-rw-r--r-- | dom/base/nsDocument.cpp | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index a1b1408a5..40bfa97e2 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3031,20 +3031,9 @@ Element* nsIDocument::GetActiveElement() { // Get the focused element. - if (nsCOMPtr<nsPIDOMWindowOuter> window = GetWindow()) { - nsCOMPtr<nsPIDOMWindowOuter> focusedWindow; - nsIContent* focusedContent = - nsFocusManager::GetFocusedDescendant(window, false, - getter_AddRefs(focusedWindow)); - // be safe and make sure the element is from this document - if (focusedContent && focusedContent->OwnerDoc() == this) { - if (focusedContent->ChromeOnlyAccess()) { - focusedContent = focusedContent->FindFirstNonChromeOnlyAccessContent(); - } - if (focusedContent) { - return focusedContent->AsElement(); - } - } + Element* focusedElement = GetRetargetedFocusedElement(); + if (focusedElement) { + return focusedElement; } // No focused element anywhere in this document. Try to get the BODY. |