From 74db060beb01129967ccd573b5493dfb0a31ad4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 30 Mar 2021 00:05:14 +0000 Subject: [PATCH] Bug 1701807 - Partially revert the regressing bug for now, gotta find something smarter to do. Differential Revision: https://phabricator.services.mozilla.com/D110180 --- layout/base/PresShell.cpp | 28 +----------------------- layout/base/PresShell.h | 4 ---- modules/libpref/init/StaticPrefList.yaml | 25 --------------------- 3 files changed, 1 insertion(+), 56 deletions(-) diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index aaaee87b130b..87449919637f 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -1822,14 +1822,10 @@ void PresShell::InitPaintSuppressionTimer() { int32_t delay = inProcess ? StaticPrefs::nglayout_initialpaint_delay() : StaticPrefs::nglayout_initialpaint_delay_in_oopif(); - if (mPaintSuppressionAttempts) { - delay += mPaintSuppressionAttempts * - StaticPrefs::nglayout_initialpaint_retry_extra_delay(); - } mPaintSuppressionTimer->InitWithNamedFuncCallback( [](nsITimer* aTimer, void* aPresShell) { RefPtr self = static_cast(aPresShell); - self->UnsuppressPaintingFromTimer(); + self->UnsuppressPainting(); }, this, delay, nsITimer::TYPE_ONE_SHOT, "PresShell::sPaintSuppressionCallback"); @@ -3912,28 +3908,6 @@ void PresShell::CancelPaintSuppressionTimer() { } } -void PresShell::UnsuppressPaintingFromTimer() { - if (mIsDocumentGone || !mPaintingSuppressed) { - CancelPaintSuppressionTimer(); - return; - } - if (!StaticPrefs::nglayout_initialpaint_unsuppress_with_no_background()) { - if (mPresContext->IsRootContentDocumentCrossProcess()) { - UpdateCanvasBackground(); - if (!mHasCSSBackgroundColor) { - // We don't unsuppress painting if the page has a transparent - // background, as that usually means that the page is unstyled. - if (mPaintSuppressionAttempts++ < - StaticPrefs::nglayout_initialpaint_retry_max_retry_count()) { - InitPaintSuppressionTimer(); - return; - } - } - } - } - UnsuppressPainting(); -} - void PresShell::UnsuppressPainting() { CancelPaintSuppressionTimer(); diff --git a/layout/base/PresShell.h b/layout/base/PresShell.h index e04004212f33..3766de592089 100644 --- a/layout/base/PresShell.h +++ b/layout/base/PresShell.h @@ -680,7 +680,6 @@ class PresShell final : public nsStubDocumentObserver, bool IsPaintingSuppressed() const { return mPaintingSuppressed; } void UnsuppressPainting(); - void UnsuppressPaintingFromTimer(); void InitPaintSuppressionTimer(); void CancelPaintSuppressionTimer(); @@ -2989,9 +2988,6 @@ class PresShell final : public nsStubDocumentObserver, // re-use old pixels. RenderingStateFlags mRenderingStateFlags; - // The amount of times that we have tried to unsuppress painting off a timer. - int32_t mPaintSuppressionAttempts = 0; - // Whether we're currently under a FlushPendingNotifications. // This is used to handle flush reentry correctly. // NOTE: This can't be a bitfield since AutoRestore has a reference to this diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index c10fd39423ca..313155116cd4 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -9325,31 +9325,6 @@ value: 5 mirror: always -# Whether we should unsuppress painting from the initial paint timer when -# there's no CSS background specified on the page. -- name: nglayout.initialpaint.unsuppress_with_no_background - type: bool - value: false - mirror: always - -# If we retried, what is the extra delay we should use. -# Note that this increment is multiplied for the current retry number. -- name: nglayout.initialpaint.retry.extra_delay - type: int32_t - # Somewhat arbitrary, but not too high so as to miss lots of frames if the - # page begins to get styled. Note that we forcefully unsuppress when the load - # event arrives too, or on max retries, so this won't block painting if the - # page has loaded. - value: 25 - mirror: always - -- name: nglayout.initialpaint.retry.max_retry_count - type: int32_t - # This gives us 5 + 30 + 55 + ... 380 == 2705ms before forcibly - # unsuppressing, which seems plenty. - value: 15 - mirror: always - #--------------------------------------------------------------------------- # Prefs starting with "page_load." #---------------------------------------------------------------------------