Bug 1415541 - No need to destroy frames if Destroy was called on the shell. r=bz

MozReview-Commit-ID: CgiFqeKHF3N
This commit is contained in:
Mats Palmgren 2017-11-16 18:58:29 +01:00
Родитель b7af3313b9
Коммит e6b1085aea
1 изменённых файлов: 3 добавлений и 2 удалений

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

@ -48,7 +48,7 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument,
*aDidPrettyPrint = false;
// Check for iframe with display:none. Such iframes don't have presshells
nsIPresShell* shell = aDocument->GetShell();
nsCOMPtr<nsIPresShell> shell = aDocument->GetShell();
if (!shell) {
return NS_OK;
}
@ -153,7 +153,8 @@ nsXMLPrettyPrinter::PrettyPrint(nsIDocument* aDocument,
GetSystemPrincipal(getter_AddRefs(sysPrincipal));
// Destroy any existing frames before we unbind anonymous content.
if (rootCont->IsElement()) {
// Note that the shell might be Destroy'ed by now (see bug 1415541).
if (!shell->IsDestroying() && rootCont->IsElement()) {
shell->DestroyFramesForAndRestyle(rootCont->AsElement());
}