Bug 1701807 - Partially revert the regressing bug for now, gotta find something smarter to do.

Differential Revision: https://phabricator.services.mozilla.com/D110180
This commit is contained in:
Emilio Cobos Álvarez 2021-03-30 00:05:14 +00:00
Родитель 990239fa5b
Коммит 74db060beb
3 изменённых файлов: 1 добавлений и 56 удалений

Просмотреть файл

@ -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<PresShell> self = static_cast<PresShell*>(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();

Просмотреть файл

@ -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

Просмотреть файл

@ -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."
#---------------------------------------------------------------------------