Bug 653839. Don't call DidPaint on hidden documents. This just does for DidPaint what bug 594267 did for WillPaint. r=roc

This commit is contained in:
Timothy Nikkel 2011-05-01 20:59:15 +02:00
parent b2f344a841
commit f18d13c30e
2 changed files with 9 additions and 3 deletions

View File

@ -7361,6 +7361,10 @@ PresShell::WillPaint(PRBool aWillSendDidPaint)
NS_IMETHODIMP_(void)
PresShell::DidPaint()
{
if (mPaintingSuppressed || !mIsActive) {
return;
}
nsRootPresContext* rootPresContext = mPresContext->GetRootPresContext();
if (!rootPresContext) {
return;

View File

@ -1694,9 +1694,11 @@ nsViewManager::CallDidPaintOnObservers()
nsViewManager* vm = (nsViewManager*)gViewManagers->ElementAt(index);
if (vm->RootViewManager() == this) {
// One of our kids.
nsCOMPtr<nsIViewObserver> obs = vm->GetViewObserver();
if (obs) {
obs->DidPaint();
if (vm->mRootView && vm->mRootView->IsEffectivelyVisible()) {
nsCOMPtr<nsIViewObserver> obs = vm->GetViewObserver();
if (obs) {
obs->DidPaint();
}
}
}
}