diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 8184bc8f87b..c3cf00e7657 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -426,6 +426,7 @@ nsViewManager::nsViewManager() mAllowDoubleBuffering = PR_TRUE; mHasPendingInvalidates = PR_FALSE; mPendingInvalidateEvent = PR_FALSE; + mRecursiveRefreshPending = PR_FALSE; } nsViewManager::~nsViewManager() @@ -693,6 +694,10 @@ void nsViewManager::Refresh(nsIView *aView, nsIRenderingContext *aContext, nsIRe #endif NS_ASSERTION(!(PR_TRUE == mPainting), "recursive painting not permitted"); + if (mPainting) { + mRecursiveRefreshPending = PR_TRUE; + return; + } mPainting = PR_TRUE; @@ -790,6 +795,11 @@ void nsViewManager::Refresh(nsIView *aView, nsIRenderingContext *aContext, nsIRe } } + if (mRecursiveRefreshPending) { + UpdateAllViews(aUpdateFlags); + mRecursiveRefreshPending = PR_FALSE; + } + #ifdef NS_VM_PERF_METRICS MOZ_TIMER_DEBUGLOG(("Stop: nsViewManager::Refresh(region), this=%p\n", this)); MOZ_TIMER_STOP(mWatch); @@ -817,6 +827,10 @@ void nsViewManager::Refresh(nsIView *aView, nsIRenderingContext *aContext, const #endif NS_ASSERTION(!(PR_TRUE == mPainting), "recursive painting not permitted"); + if (mPainting) { + mRecursiveRefreshPending = PR_TRUE; + return; + } mPainting = PR_TRUE; @@ -920,6 +934,11 @@ void nsViewManager::Refresh(nsIView *aView, nsIRenderingContext *aContext, const } } + if (mRecursiveRefreshPending) { + UpdateAllViews(aUpdateFlags); + mRecursiveRefreshPending = PR_FALSE; + } + #ifdef NS_VM_PERF_METRICS MOZ_TIMER_DEBUGLOG(("Stop: nsViewManager::Refresh(region), this=%p\n", this)); MOZ_TIMER_STOP(mWatch); diff --git a/mozilla/view/src/nsViewManager.h b/mozilla/view/src/nsViewManager.h index f7e041881f4..4a6498959bb 100644 --- a/mozilla/view/src/nsViewManager.h +++ b/mozilla/view/src/nsViewManager.h @@ -316,6 +316,7 @@ private: PRInt32 mTransCnt; PRBool mRefreshEnabled; PRBool mPainting; + PRBool mRecursiveRefreshPending; nsIView *mMouseGrabber; nsIView *mKeyGrabber; PRInt32 mUpdateCnt;