Issue #2135 - Bug 1393806/Part 1: Change nsNodeUtils cloning/adopting stuff to use an ErrorResult for errors

This will allow us to propagate out more informative errors in some cases.
This commit is contained in:
FranklinDM 2023-03-04 17:05:41 +08:00 committed by roytam1
commit e65a864a3e
6 changed files with 100 additions and 103 deletions

View file

@ -259,14 +259,12 @@ SVGUseElement::CreateAnonymousContent()
}
}
nsCOMPtr<nsINode> newnode;
nsCOMArray<nsINode> unused;
nsNodeInfoManager* nodeInfoManager =
targetContent->OwnerDoc() == OwnerDoc() ?
nullptr : OwnerDoc()->NodeInfoManager();
nsNodeUtils::Clone(targetContent, true, nodeInfoManager, unused,
getter_AddRefs(newnode));
IgnoredErrorResult rv;
nsCOMPtr<nsINode> newnode =
nsNodeUtils::Clone(targetContent, true, nodeInfoManager, nullptr, rv);
nsCOMPtr<nsIContent> newcontent = do_QueryInterface(newnode);
if (!newcontent)