Bug 493702. Paint subdocuments across iframe boundaries in print presentations when we don't have docshells. r=roc

--HG--
extra : rebase_source : 742a62c9d4940267fee10f58ed7b1ce26909be2a
This commit is contained in:
Timothy Nikkel 2009-05-19 21:57:31 +12:00
Родитель d8d488ca5a
Коммит ceb2cb5256
1 изменённых файлов: 17 добавлений и 16 удалений

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

@ -320,33 +320,34 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!subdocView)
return NS_OK;
// Get the PresShell so we can check if painting is suppressed
// on the subdocument. We use this roundabout way in case we
// don't have a frame tree.
if (!mFrameLoader)
return NS_OK;
nsCOMPtr<nsIDocShell> docShell;
mFrameLoader->GetDocShell(getter_AddRefs(docShell));
if (!docShell)
return NS_OK;
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
if (!presShell)
return NS_OK;
nsIFrame* f = static_cast<nsIFrame*>(subdocView->GetClientData());
if (f) {
presShell = f->PresContext()->PresShell();
} else {
// If we don't have a frame we use this roundabout way to get the pres shell.
if (!mFrameLoader)
return NS_OK;
nsCOMPtr<nsIDocShell> docShell;
mFrameLoader->GetDocShell(getter_AddRefs(docShell));
if (!docShell)
return NS_OK;
docShell->GetPresShell(getter_AddRefs(presShell));
if (!presShell)
return NS_OK;
}
PRBool suppressed = PR_TRUE;
presShell->IsPaintingSuppressed(&suppressed);
nsIFrame* f = static_cast<nsIFrame*>(subdocView->GetClientData());
nsDisplayList childItems;
nsRect dirty;
if (f) {
dirty = aDirtyRect - f->GetOffsetTo(this);
aBuilder->EnterPresShell(f, dirty);
NS_ASSERTION(presShell == f->PresContext()->PresShell(),
"these presshells should be the same");
rv = f->BuildDisplayListForStackingContext(aBuilder, dirty, &childItems);
}