зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1490561 - Make sure we remove our RefreshDriver observers in CompleteAsyncScroll. r=emilio
This commit is contained in:
Родитель
569d0d514e
Коммит
729982d840
|
@ -2270,8 +2270,7 @@ void
|
|||
ScrollFrameHelper::CompleteAsyncScroll(const nsRect &aRange, nsAtom* aOrigin)
|
||||
{
|
||||
// Apply desired destination range since this is the last step of scrolling.
|
||||
mAsyncSmoothMSDScroll = nullptr;
|
||||
mAsyncScroll = nullptr;
|
||||
RemoveObservers();
|
||||
AutoWeakFrame weakFrame(mOuter);
|
||||
ScrollToImpl(mDestination, aRange, aOrigin);
|
||||
if (!weakFrame.IsAlive()) {
|
||||
|
@ -4934,14 +4933,23 @@ ScrollFrameHelper::Destroy(PostDestroyData& aPostDestroyData)
|
|||
mScrollActivityTimer->Cancel();
|
||||
mScrollActivityTimer = nullptr;
|
||||
}
|
||||
RemoveObservers();
|
||||
}
|
||||
|
||||
void
|
||||
ScrollFrameHelper::RemoveObservers()
|
||||
{
|
||||
if (mAsyncScroll) {
|
||||
mAsyncScroll->RemoveObserver();
|
||||
mAsyncScroll = nullptr;
|
||||
}
|
||||
if (mAsyncSmoothMSDScroll) {
|
||||
mAsyncSmoothMSDScroll->RemoveObserver();
|
||||
mAsyncSmoothMSDScroll = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called when we want to update the scrollbar position, either because scrolling happened
|
||||
* or the user moved the scrollbar position and we need to undo that (e.g., when the user
|
||||
|
|
|
@ -690,6 +690,9 @@ protected:
|
|||
|
||||
bool IsForTextControlWithNoScrollbars() const;
|
||||
|
||||
// Removes any RefreshDriver observers we might have registered.
|
||||
void RemoveObservers();
|
||||
|
||||
static void EnsureFrameVisPrefsCached();
|
||||
static bool sFrameVisPrefsCached;
|
||||
// The number of scrollports wide/high to expand when tracking frame visibility.
|
||||
|
|
Загрузка…
Ссылка в новой задаче