Bug 132905. Tweak CreateTemplatecontents slightly to help isolate a topcrash. r=rjc, sr=alecf

This commit is contained in:
waterson%netscape.com 2002-05-08 18:50:41 +00:00
Родитель b9ce27fb9d
Коммит 3c0cb35a20
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -1360,7 +1360,7 @@ nsXULContentBuilder::CreateTemplateContents(nsIContent* aElement,
nsCOMPtr<nsIRDFResource> resource;
nsCOMPtr<nsIContent> element = aElement;
while (element) {
while (1) {
nsXULContentUtils::GetElementRefResource(element, getter_AddRefs(resource));
if (resource)
break;
@ -1369,11 +1369,16 @@ nsXULContentBuilder::CreateTemplateContents(nsIContent* aElement,
element->GetParent(*getter_AddRefs(parent));
element = parent;
NS_ASSERTION(element != nsnull,
"walked to the root of the content model without finding template root");
}
nsTemplateMatch* match;
nsTemplateMatch* match = nsnull;
mContentSupportMap.Get(element, &match);
NS_ASSERTION(match != nsnull, "no match in the content support map");
rv = BuildContentFromTemplate(aTemplateElement, aElement, aElement, PR_FALSE, resource, PR_FALSE,
match, aContainer, aNewIndexInContainer);