diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 07:23:48 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-04-17 07:23:48 -0400 |
commit | f0b7ba1e2b49858ce2755c61beebe3694cae882f (patch) | |
tree | 9e77a30d9d833bcbde854db394148db523450526 /dom/base/nsContentUtils.cpp | |
parent | 003e537dcbaa524fcaa5e36a834278a00653bdef (diff) | |
download | UXP-f0b7ba1e2b49858ce2755c61beebe3694cae882f.tar UXP-f0b7ba1e2b49858ce2755c61beebe3694cae882f.tar.gz UXP-f0b7ba1e2b49858ce2755c61beebe3694cae882f.tar.lz UXP-f0b7ba1e2b49858ce2755c61beebe3694cae882f.tar.xz UXP-f0b7ba1e2b49858ce2755c61beebe3694cae882f.zip |
Bug 1419799 - Fix nsContentUtils::IsInSameAnonymousTree in Shadow DOM
Tag #1375
Diffstat (limited to 'dom/base/nsContentUtils.cpp')
-rw-r--r-- | dom/base/nsContentUtils.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 62be71b4a..502c40977 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -4955,17 +4955,7 @@ nsContentUtils::IsInSameAnonymousTree(const nsINode* aNode, return aContent->GetBindingParent() == nullptr; } - const nsIContent* nodeAsContent = static_cast<const nsIContent*>(aNode); - - // For nodes in a shadow tree, it is insufficient to simply compare - // the binding parent because a node may host multiple ShadowRoots, - // thus nodes in different shadow tree may have the same binding parent. - if (aNode->IsInShadowTree()) { - return nodeAsContent->GetContainingShadow() == - aContent->GetContainingShadow(); - } - - return nodeAsContent->GetBindingParent() == aContent->GetBindingParent(); + return aNode->AsContent()->GetBindingParent() == aContent->GetBindingParent(); } class AnonymousContentDestroyer : public Runnable { |