Bug 1668966. Only clear PresShell::mResolutionUpdated after the apz transaction. r=kats,botond

We clear PresShell::mResolutionUpdated in nsLayoutUtils::ComputeScrollMetadata here

https://searchfox.org/mozilla-central/rev/7ef5cefd0468b8f509efe38e0212de2398f4c8b3/layout/base/nsLayoutUtils.cpp#9419

but that is incorrect because we call ComputeScrollMetadata twice for one transaction with webrender. This is why ScrollFrameHelper::NotifyApzTransaction exists: to clear things on the layout side after they are sent to the compositor.

Differential Revision: https://phabricator.services.mozilla.com/D92316
This commit is contained in:
Timothy Nikkel 2020-10-04 21:26:46 +00:00
Родитель 700c9a4115
Коммит 35245411b9
2 изменённых файлов: 7 добавлений и 2 удалений

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

@ -767,6 +767,10 @@ bool nsLayoutUtils::ShouldDisableApzForElement(nsIContent* aContent) {
void nsLayoutUtils::NotifyPaintSkipTransaction(ViewID aScrollId) {
if (nsIScrollableFrame* scrollFrame =
nsLayoutUtils::FindScrollableFrameFor(aScrollId)) {
#ifdef DEBUG
nsIFrame* f = do_QueryFrame(scrollFrame);
MOZ_ASSERT(f && f->PresShell() && !f->PresShell()->IsResolutionUpdated());
#endif
scrollFrame->NotifyApzTransaction();
}
}
@ -8537,8 +8541,6 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
if (presShell->IsResolutionUpdated()) {
metadata.SetResolutionUpdated(true);
// We only need to tell APZ about the resolution update once.
presShell->SetResolutionUpdated(false);
}
// The cumulative resolution is the resolution at which the scroll frame's

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

@ -4332,6 +4332,9 @@ void ScrollFrameHelper::NotifyApzTransaction() {
mApzScrollPos = GetScrollPosition();
mApzAnimationRequested = IsLastScrollUpdateAnimating();
mScrollUpdates.Clear();
if (mIsRoot) {
mOuter->PresShell()->SetResolutionUpdated(false);
}
}
Maybe<ScrollMetadata> ScrollFrameHelper::ComputeScrollMetadata(