Bug 1830778 - Rename some contentful paint related variables/functions to make it clear they are based on FirstContentfulPaint r=emilio

Currently these functions and related variables are based on
FirstContentfulPaint, however the naming are too generic. With the
LargestContentfulPaint implementation, they will not only
handle paints for FirstContentfulPaint but also LargestContentfulPaint,
so we need to rename them.

Differential Revision: https://phabricator.services.mozilla.com/D151077
This commit is contained in:
Sean Feng 2023-05-01 22:11:40 +00:00
Родитель 439df49bed
Коммит 2d1d0cda93
5 изменённых файлов: 11 добавлений и 10 удалений

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

@ -10676,7 +10676,7 @@ bool nsContentUtils::
"Should never have a chrome PresContext in a content process");
return !presContext->GetInProcessRootContentDocumentPresContext()
->HadContentfulPaint() &&
->HadFirstContentfulPaint() &&
nsThreadManager::MainThreadHasPendingHighPriorityEvents();
}
}

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

@ -284,7 +284,7 @@ nsPresContext::nsPresContext(dom::Document* aDocument, nsPresContextType aType)
mHasWarnedAboutTooLargeDashedOrDottedRadius(false),
mQuirkSheetAdded(false),
mHadNonBlankPaint(false),
mHadContentfulPaint(false),
mHadFirstContentfulPaint(false),
mHadNonTickContentfulPaint(false),
mHadContentfulPaintComposite(false),
#ifdef DEBUG
@ -2726,7 +2726,7 @@ void nsPresContext::NotifyNonBlankPaint() {
}
void nsPresContext::NotifyContentfulPaint() {
if (mHadContentfulPaint) {
if (mHadFirstContentfulPaint) {
return;
}
nsRootPresContext* rootPresContext = GetRootPresContext();
@ -2748,7 +2748,7 @@ void nsPresContext::NotifyContentfulPaint() {
}
return;
}
mHadContentfulPaint = true;
mHadFirstContentfulPaint = true;
mFirstContentfulPaintTransactionId =
Some(rootPresContext->mRefreshDriver->LastTransactionId().Next());
if (nsPIDOMWindowInner* innerWindow = mDocument->GetInnerWindow()) {
@ -2788,7 +2788,7 @@ void nsPresContext::NotifyContentfulPaint() {
void nsPresContext::NotifyPaintStatusReset() {
mHadNonBlankPaint = false;
mHadContentfulPaint = false;
mHadFirstContentfulPaint = false;
#if defined(MOZ_WIDGET_ANDROID)
(new AsyncEventDispatcher(mDocument, u"MozPaintStatusReset"_ns,
CanBubble::eYes, ChromeOnlyDispatch::eYes))

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

@ -1046,7 +1046,7 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
bool IsRootContentDocumentCrossProcess() const;
bool HadNonBlankPaint() const { return mHadNonBlankPaint; }
bool HadContentfulPaint() const { return mHadContentfulPaint; }
bool HadFirstContentfulPaint() const { return mHadFirstContentfulPaint; }
void NotifyNonBlankPaint();
void NotifyContentfulPaint();
void NotifyPaintStatusReset();
@ -1358,7 +1358,7 @@ class nsPresContext : public nsISupports, public mozilla::SupportsWeakPtr {
// Has NotifyNonBlankPaint been called on this PresContext?
unsigned mHadNonBlankPaint : 1;
// Has NotifyContentfulPaint been called on this PresContext?
unsigned mHadContentfulPaint : 1;
unsigned mHadFirstContentfulPaint : 1;
// True when a contentful paint has happened and this paint doesn't
// come from the regular tick process. Usually this means a
// contentful paint was triggered manually.

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

@ -711,7 +711,7 @@ class VsyncRefreshDriverTimer : public RefreshDriverTimer {
if (StaticPrefs::layout_lower_priority_refresh_driver_during_load() &&
ShouldGiveNonVsyncTasksMoreTime()) {
nsPresContext* pctx = GetPresContextForOnlyRefreshDriver();
if (pctx && pctx->HadContentfulPaint() && pctx->Document() &&
if (pctx && pctx->HadFirstContentfulPaint() && pctx->Document() &&
pctx->Document()->GetReadyStateEnum() <
Document::READYSTATE_COMPLETE) {
nsPIDOMWindowInner* win = pctx->Document()->GetInnerWindow();
@ -1992,7 +1992,8 @@ bool nsRefreshDriver::
if (mThrottled || mTestControllingRefreshes || !XRE_IsContentProcess() ||
!mPresContext->Document()->IsTopLevelContentDocument() ||
mPresContext->Document()->IsInitialDocument() ||
gfxPlatform::IsInLayoutAsapMode() || mPresContext->HadContentfulPaint() ||
gfxPlatform::IsInLayoutAsapMode() ||
mPresContext->HadFirstContentfulPaint() ||
mPresContext->Document()->GetReadyStateEnum() ==
Document::READYSTATE_COMPLETE) {
return false;

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

@ -1253,7 +1253,7 @@ void nsDisplayListBuilder::LeavePresShell(const nsIFrame* aReferenceFrame,
}
}
nsRootPresContext* rootPresContext = pc->GetRootPresContext();
if (!pc->HadContentfulPaint() && rootPresContext) {
if (!pc->HadFirstContentfulPaint() && rootPresContext) {
if (!CurrentPresShellState()->mIsBackgroundOnly) {
if (pc->HasEverBuiltInvisibleText() ||
DisplayListIsContentful(this, aPaintedContents)) {