mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 253889: DeCOMtaminate nsIPresShell - IsPaintingSuppressed(). r=roc
--HG-- extra : rebase_source : 9ee8283e8bce33402893ae5316f89c9f699a1236
This commit is contained in:
parent
8ef02ed2f5
commit
afa4c872e5
@ -307,9 +307,7 @@ nsImageLoadingContent::OnStopDecode(imgIRequest* aRequest,
|
||||
// to be suppressed for reasons other than the initial paint delay (for
|
||||
// example - being in the bfcache), but we probably aren't loading images in
|
||||
// those situations.
|
||||
PRBool isSuppressed = PR_FALSE;
|
||||
nsresult rv = shell->IsPaintingSuppressed(&isSuppressed);
|
||||
if (NS_SUCCEEDED(rv) && isSuppressed)
|
||||
if (shell->IsPaintingSuppressed())
|
||||
doRequestDecode = PR_TRUE;
|
||||
|
||||
// If we're requesting a decode, do it
|
||||
|
@ -7223,9 +7223,7 @@ ApplyRenderingChangeToTree(nsPresContext* aPresContext,
|
||||
nsChangeHint aChange)
|
||||
{
|
||||
nsIPresShell *shell = aPresContext->PresShell();
|
||||
PRBool isPaintingSuppressed = PR_FALSE;
|
||||
shell->IsPaintingSuppressed(&isPaintingSuppressed);
|
||||
if (isPaintingSuppressed) {
|
||||
if (shell->IsPaintingSuppressed()) {
|
||||
// Don't allow synchronous rendering changes when painting is turned off.
|
||||
aChange = NS_SubtractHint(aChange, nsChangeHint_RepaintFrame);
|
||||
if (!aChange) {
|
||||
|
@ -1005,9 +1005,7 @@ void nsCaret::DrawCaret(PRBool aInvalidate)
|
||||
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
|
||||
NS_ENSURE_TRUE(presShell, /**/);
|
||||
{
|
||||
PRBool isPaintingSuppressed;
|
||||
presShell->IsPaintingSuppressed(&isPaintingSuppressed);
|
||||
if (isPaintingSuppressed)
|
||||
if (presShell->IsPaintingSuppressed())
|
||||
{
|
||||
if (!mDrawn)
|
||||
mPendingDraw = PR_TRUE;
|
||||
|
@ -82,9 +82,7 @@ nsDisplayListBuilder::nsDisplayListBuilder(nsIFrame* aReferenceFrame,
|
||||
|
||||
nsPresContext* pc = aReferenceFrame->PresContext();
|
||||
nsIPresShell *shell = pc->PresShell();
|
||||
PRBool suppressed;
|
||||
shell->IsPaintingSuppressed(&suppressed);
|
||||
mIsBackgroundOnly = suppressed;
|
||||
mIsBackgroundOnly = shell->IsPaintingSuppressed();
|
||||
if (pc->IsRenderingOnlySelection()) {
|
||||
nsCOMPtr<nsISelectionController> selcon(do_QueryInterface(shell));
|
||||
if (selcon) {
|
||||
|
@ -676,12 +676,12 @@ public:
|
||||
* we don't allow the painting of any layer but the background, and we don't
|
||||
* recur into our children.
|
||||
*/
|
||||
NS_IMETHOD IsPaintingSuppressed(PRBool* aResult)=0;
|
||||
virtual NS_HIDDEN_(PRBool) IsPaintingSuppressed() const = 0;
|
||||
|
||||
/**
|
||||
* Unsuppress painting.
|
||||
*/
|
||||
NS_IMETHOD UnsuppressPainting() = 0;
|
||||
virtual NS_HIDDEN_(void) UnsuppressPainting() = 0;
|
||||
|
||||
/**
|
||||
* Called to disable nsITheme support in a specific presshell.
|
||||
|
@ -741,8 +741,8 @@ public:
|
||||
|
||||
virtual NS_HIDDEN_(nsresult) CaptureHistoryState(nsILayoutHistoryState** aLayoutHistoryState, PRBool aLeavingPage);
|
||||
|
||||
NS_IMETHOD IsPaintingSuppressed(PRBool* aResult);
|
||||
NS_IMETHOD UnsuppressPainting();
|
||||
virtual NS_HIDDEN_(PRBool) IsPaintingSuppressed() const;
|
||||
virtual NS_HIDDEN_(void) UnsuppressPainting();
|
||||
|
||||
virtual NS_HIDDEN_(void) DisableThemeSupport();
|
||||
virtual PRBool IsThemeSupportEnabled();
|
||||
@ -4393,11 +4393,10 @@ PresShell::CaptureHistoryState(nsILayoutHistoryState** aState, PRBool aLeavingPa
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PresShell::IsPaintingSuppressed(PRBool* aResult)
|
||||
PRBool
|
||||
PresShell::IsPaintingSuppressed() const
|
||||
{
|
||||
*aResult = mPaintingSuppressed;
|
||||
return NS_OK;
|
||||
return mPaintingSuppressed;
|
||||
}
|
||||
|
||||
void
|
||||
@ -4434,7 +4433,7 @@ PresShell::UnsuppressAndInvalidate()
|
||||
mViewManager->SynthesizeMouseMove(PR_FALSE);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
void
|
||||
PresShell::UnsuppressPainting()
|
||||
{
|
||||
if (mPaintSuppressionTimer) {
|
||||
@ -4443,7 +4442,7 @@ PresShell::UnsuppressPainting()
|
||||
}
|
||||
|
||||
if (mIsDocumentGone || !mPaintingSuppressed)
|
||||
return NS_OK;
|
||||
return;
|
||||
|
||||
// If we have reflows pending, just wait until we process
|
||||
// the reflows and get all the frames where we want them
|
||||
@ -4453,7 +4452,6 @@ PresShell::UnsuppressPainting()
|
||||
mShouldUnsuppressPainting = PR_TRUE;
|
||||
else
|
||||
UnsuppressAndInvalidate();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -3676,12 +3676,10 @@ nsIFrame::InvalidateWithFlags(const nsRect& aDamageRect, PRUint32 aFlags)
|
||||
// painting is suppressed.
|
||||
nsIPresShell *shell = PresContext()->GetPresShell();
|
||||
if (shell) {
|
||||
PRBool suppressed = PR_FALSE;
|
||||
shell->IsPaintingSuppressed(&suppressed);
|
||||
if (suppressed)
|
||||
if (shell->IsPaintingSuppressed())
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
InvalidateInternal(aDamageRect, 0, 0, nsnull, aFlags);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user