Bug 989224: Note orphaned FragmentOrElements in the CC log. r=bz

This commit is contained in:
Kyle Huey 2014-04-01 11:33:28 +08:00
parent 921c8aeb38
commit 7ee146283b

View File

@ -1766,12 +1766,21 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
classes.AppendLiteral("'");
}
nsAutoCString orphan;
if (!tmp->IsInDoc() &&
// Ignore xbl:content, which is never in the document and hence always
// appears to be orphaned.
!tmp->NodeInfo()->Equals(nsGkAtoms::content, kNameSpaceID_XBL)) {
orphan.AppendLiteral(" (orphan)");
}
const char* nsuri = nsid < ArrayLength(kNSURIs) ? kNSURIs[nsid] : "";
PR_snprintf(name, sizeof(name), "FragmentOrElement%s %s%s%s %s",
PR_snprintf(name, sizeof(name), "FragmentOrElement%s %s%s%s%s %s",
nsuri,
localName.get(),
NS_ConvertUTF16toUTF8(id).get(),
NS_ConvertUTF16toUTF8(classes).get(),
orphan.get(),
uri.get());
cb.DescribeRefCountedNode(tmp->mRefCnt.get(), name);
}