Bug 1643042 - Switch mLastSmoothScrollOrigin to using None as well. r=tnikkel

This uses "None" instead of "NotSpecified" as the value for
mLastSmoothScrollOrigin when there is no smooth scroll in progress.

Depends on D78439

Differential Revision: https://phabricator.services.mozilla.com/D78469
This commit is contained in:
Kartikaya Gupta 2020-06-05 09:41:07 +00:00
Родитель 445d9cf0b8
Коммит c06eb6ae82
5 изменённых файлов: 11 добавлений и 11 удалений

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

@ -818,7 +818,7 @@ void APZCCallbackHelper::NotifyFlushComplete(PresShell* aPresShell) {
bool APZCCallbackHelper::IsScrollInProgress(nsIScrollableFrame* aFrame) {
return aFrame->IsProcessingAsyncScroll() ||
nsLayoutUtils::CanScrollOriginClobberApz(aFrame->LastScrollOrigin()) ||
aFrame->LastSmoothScrollOrigin() != ScrollOrigin::NotSpecified;
aFrame->LastSmoothScrollOrigin() != ScrollOrigin::None;
}
/* static */

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

@ -9185,7 +9185,7 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
ScrollOrigin lastSmoothScrollOrigin =
scrollableFrame->LastSmoothScrollOrigin();
if (lastSmoothScrollOrigin != ScrollOrigin::NotSpecified) {
if (lastSmoothScrollOrigin != ScrollOrigin::None) {
metrics.SetSmoothScrollOffsetUpdated(
scrollableFrame->CurrentScrollGeneration());
}

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

@ -13,13 +13,13 @@ namespace mozilla {
enum class ScrollOrigin : uint8_t {
// This is used as an initial value for the "LastScrollOrigin" property on
// scrollable frames. It is not intended to be an actual scroll origin, but
// a sentinel value that indicates that there was no "last scroll".
// a sentinel value that indicates that there was no "last scroll". It is
// used similarly for the "LastSmoothScrollOrigin" property, to indicate
// no smooth scroll is in progress.
None,
// This is a default value that we use when we don't know of a more specific
// value that we can use. Note that for the "LastSmoothScrollOrigin" property
// on a scrollable frame, the NotSpecified value is special, in that it means
// there is no smooth scroll in progress.
// value that we can use.
NotSpecified,
// The scroll came from APZ code.
Apz,

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

@ -2090,7 +2090,7 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter, bool aIsRoot)
mAsyncScroll(nullptr),
mAsyncSmoothMSDScroll(nullptr),
mLastScrollOrigin(ScrollOrigin::None),
mLastSmoothScrollOrigin(ScrollOrigin::NotSpecified),
mLastSmoothScrollOrigin(ScrollOrigin::None),
mScrollGeneration(++sScrollGenerationCounter),
mDestination(0, 0),
mRestorePos(-1, -1),
@ -2893,7 +2893,7 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
mLastScrollOrigin = aOrigin;
mAllowScrollOriginDowngrade = false;
}
mLastSmoothScrollOrigin = ScrollOrigin::NotSpecified;
mLastSmoothScrollOrigin = ScrollOrigin::None;
mScrollGeneration = ++sScrollGenerationCounter;
if (mLastScrollOrigin == ScrollOrigin::Apz) {
mApzScrollPos = GetScrollPosition();
@ -6655,7 +6655,7 @@ UniquePtr<PresState> ScrollFrameHelper::SaveState() const {
// Don't store a scroll state if we never have been scrolled or restored
// a previous scroll state, and we're not in the middle of a smooth scroll.
bool isInSmoothScroll = IsProcessingAsyncScroll() ||
mLastSmoothScrollOrigin != ScrollOrigin::NotSpecified;
mLastSmoothScrollOrigin != ScrollOrigin::None;
if (!mHasBeenScrolled && !mDidHistoryRestore && !isInSmoothScroll) {
return nullptr;
}
@ -7244,7 +7244,7 @@ void ScrollFrameHelper::ApzSmoothScrollTo(const nsPoint& aDestination,
// The animation will be handled in the compositor, pass the
// information needed to start the animation and skip the main-thread
// animation for this scroll.
MOZ_ASSERT(aOrigin != ScrollOrigin::NotSpecified);
MOZ_ASSERT(aOrigin != ScrollOrigin::None);
mLastSmoothScrollOrigin = aOrigin;
mApzSmoothScrollDestination = Some(aDestination);
mScrollGeneration = ++sScrollGenerationCounter;

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

@ -467,7 +467,7 @@ class ScrollFrameHelper : public nsIReflowCallback {
void ResetScrollInfoIfGeneration(uint32_t aGeneration) {
if (aGeneration == mScrollGeneration) {
mLastScrollOrigin = ScrollOrigin::NotSpecified;
mLastSmoothScrollOrigin = ScrollOrigin::NotSpecified;
mLastSmoothScrollOrigin = ScrollOrigin::None;
}
}
bool WantAsyncScroll() const;