summaryrefslogtreecommitdiffstats
path: root/dom/base/nsFocusManager.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-06-13 08:23:21 -0400
committerMatt A. Tobin <email@mattatobin.com>2020-06-13 08:23:21 -0400
commit5e7917e2c8bd50754535652014c1de0054841912 (patch)
treeead6813f00c5ff538adad2b2aa8406732ffeb2b4 /dom/base/nsFocusManager.cpp
parent43725c7264ca3f63de348d1d1596ce1fe9e64d2d (diff)
downloadUXP-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/nsFocusManager.cpp')
-rw-r--r--dom/base/nsFocusManager.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
index c14087c8a..3fc9546e8 100644
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -813,10 +813,11 @@ nsFocusManager::ContentRemoved(nsIDocument* aDocument, nsIContent* aContent)
if (!window)
return NS_OK;
- // if the content is currently focused in the window, or is an ancestor
- // of the currently focused element, reset the focus within that window.
+ // if the content is currently focused in the window, or is an
+ // shadow-including inclusive ancestor of the currently focused element,
+ // reset the focus within that window.
nsIContent* content = window->GetFocusedNode();
- if (content && nsContentUtils::ContentIsDescendantOf(content, aContent)) {
+ if (content && nsContentUtils::ContentIsHostIncludingDescendantOf(content, aContent)) {
bool shouldShowFocusRing = window->ShouldShowFocusRing();
window->SetFocusedNode(nullptr);