Add ownerDocument to reachable list when needed. b=241518 r=bzbarsky sr=jst

git-svn-id: svn://10.0.0.236/trunk@185732 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%dbaron.org 2005-12-06 05:50:12 +00:00
parent 4c020e2d54
commit dfd0a1dbe2
2 changed files with 18 additions and 0 deletions

View File

@ -655,6 +655,15 @@ nsGenericDOMDataNode::GetSCCIndex()
void
nsGenericDOMDataNode::AppendReachableList(nsCOMArray<nsIDOMGCParticipant>& aArray)
{
NS_ASSERTION(GetCurrentDoc() == nsnull,
"shouldn't be an SCC index if we're in a doc");
NS_ASSERTION(GetOwnerDoc(), "no owner document");
// This node is the root of a subtree that's been removed from the
// document (since AppendReachableList is only called on SCC index
// nodes). The document is reachable from it (through
// .ownerDocument), but it's not reachable from the document.
aArray.AppendObject(GetOwnerDoc());
}
nsresult

View File

@ -1046,6 +1046,15 @@ nsGenericElement::GetSCCIndex()
void
nsGenericElement::AppendReachableList(nsCOMArray<nsIDOMGCParticipant>& aArray)
{
NS_ASSERTION(GetCurrentDoc() == nsnull,
"shouldn't be an SCC index if we're in a doc");
NS_ASSERTION(GetOwnerDoc(), "no owner document");
// This node is the root of a subtree that's been removed from the
// document (since AppendReachableList is only called on SCC index
// nodes). The document is reachable from it (through
// .ownerDocument), but it's not reachable from the document.
aArray.AppendObject(GetOwnerDoc());
}
NS_IMETHODIMP