mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1596768 - Remove GetBindingParentUsage in xpath. r=smaug
Wants to check that the change happens in the same anon tree, use the right function for that. Depends on D53199 Differential Revision: https://phabricator.services.mozilla.com/D53200 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
bbbd04084e
commit
1881ee2c15
@ -205,22 +205,11 @@ nsresult XPathResult::SetExprResult(txAExprResult* aExprResult,
|
||||
|
||||
void XPathResult::Invalidate(const nsIContent* aChangeRoot) {
|
||||
nsCOMPtr<nsINode> contextNode = do_QueryReferent(mContextNode);
|
||||
if (contextNode && aChangeRoot && aChangeRoot->GetBindingParent()) {
|
||||
// If context node is in anonymous content, changes to
|
||||
// non-anonymous content need to invalidate the XPathResult. If
|
||||
// the changes are happening in a different anonymous trees, no
|
||||
// invalidation should happen.
|
||||
nsIContent* ctxBindingParent = nullptr;
|
||||
if (contextNode->IsContent()) {
|
||||
ctxBindingParent = contextNode->AsContent()->GetBindingParent();
|
||||
} else if (auto* attr = Attr::FromNode(contextNode)) {
|
||||
if (Element* parent = attr->GetElement()) {
|
||||
ctxBindingParent = parent->GetBindingParent();
|
||||
}
|
||||
}
|
||||
if (ctxBindingParent != aChangeRoot->GetBindingParent()) {
|
||||
return;
|
||||
}
|
||||
// If the changes are happening in a different anonymous trees, no
|
||||
// invalidation should happen.
|
||||
if (contextNode && aChangeRoot &&
|
||||
!nsContentUtils::IsInSameAnonymousTree(contextNode, aChangeRoot)) {
|
||||
return;
|
||||
}
|
||||
|
||||
mInvalidIteratorState = true;
|
||||
|
Loading…
Reference in New Issue
Block a user