Bug 593892. Draw the previous page if the new page is suppressed. r=roc a=roc

This commit is contained in:
Timothy Nikkel 2010-09-11 13:24:49 -05:00
parent 62acd08cbd
commit 1c39c6df06
2 changed files with 21 additions and 7 deletions

View File

@ -213,6 +213,10 @@ public:
* so that methods like GetFrameForPoint work when painting is suppressed.
*/
void IgnorePaintSuppression() { mIgnoreSuppression = PR_TRUE; }
/**
* @return Returns if this builder will ignore paint suppression.
*/
PRBool IsIgnoringPaintSuppression() { return mIgnoreSuppression; }
/**
* @return Returns if this builder had to ignore painting suppression on some
* document when building the display list.

View File

@ -263,25 +263,35 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (!subdocView)
return NS_OK;
nsCOMPtr<nsIPresShell> presShell;
nsCOMPtr<nsIPresShell> presShell = nsnull;
nsIFrame* subdocRootFrame =
static_cast<nsIFrame*>(subdocView->GetClientData());
if (subdocRootFrame) {
presShell = subdocRootFrame->PresContext()->PresShell();
} else {
}
// If painting is suppressed in the presshell, we try to look for a better
// presshell to use.
if (!presShell || (presShell->IsPaintingSuppressed() &&
!aBuilder->IsIgnoringPaintSuppression())) {
// During page transition mInnerView will sometimes have two children, the
// first being the new page that may not have any frame, and the second
// being the old page that will probably have a frame.
nsIView* nextView = subdocView->GetNextSibling();
nsIFrame* frame = nsnull;
if (nextView) {
subdocRootFrame = static_cast<nsIFrame*>(nextView->GetClientData());
frame = static_cast<nsIFrame*>(nextView->GetClientData());
}
if (subdocRootFrame) {
subdocView = nextView;
presShell = subdocRootFrame->PresContext()->PresShell();
} else {
if (frame) {
nsIPresShell* ps = frame->PresContext()->PresShell();
if (!presShell || (ps && !ps->IsPaintingSuppressed())) {
subdocView = nextView;
subdocRootFrame = frame;
presShell = ps;
}
}
if (!presShell) {
// If we don't have a frame we use this roundabout way to get the pres shell.
if (!mFrameLoader)
return NS_OK;