mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 08:18:41 +09:00
Bug 1419799 - Fix nsContentUtils::IsInSameAnonymousTree in Shadow DOM
Tag #1375
This commit is contained in:
parent
eaf0831388
commit
6d8e6e8955
3 changed files with 19 additions and 11 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue