mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 961280 - Prevent the APZ repaint request from clobbering a layout-driven async scroll. r=tn
This commit is contained in:
parent
f3e2f3fee2
commit
9904e24f5a
@ -270,6 +270,7 @@ public:
|
||||
bool IsLTR() const;
|
||||
bool IsScrollbarOnRight() const;
|
||||
bool IsScrollingActive() const { return mScrollingActive || mShouldBuildScrollableLayer; }
|
||||
bool IsProcessingAsyncScroll() const { return mAsyncScroll != nullptr; }
|
||||
void ResetScrollPositionForLayerPixelAlignment()
|
||||
{
|
||||
mScrollPosForLayerPixelAlignment = GetScrollPosition();
|
||||
@ -636,6 +637,9 @@ public:
|
||||
virtual bool IsScrollingActive() MOZ_OVERRIDE {
|
||||
return mHelper.IsScrollingActive();
|
||||
}
|
||||
virtual bool IsProcessingAsyncScroll() MOZ_OVERRIDE {
|
||||
return mHelper.IsProcessingAsyncScroll();
|
||||
}
|
||||
virtual void ResetScrollPositionForLayerPixelAlignment() MOZ_OVERRIDE {
|
||||
mHelper.ResetScrollPositionForLayerPixelAlignment();
|
||||
}
|
||||
@ -934,6 +938,9 @@ public:
|
||||
virtual bool IsScrollingActive() MOZ_OVERRIDE {
|
||||
return mHelper.IsScrollingActive();
|
||||
}
|
||||
virtual bool IsProcessingAsyncScroll() MOZ_OVERRIDE {
|
||||
return mHelper.IsProcessingAsyncScroll();
|
||||
}
|
||||
virtual void ResetScrollPositionForLayerPixelAlignment() MOZ_OVERRIDE {
|
||||
mHelper.ResetScrollPositionForLayerPixelAlignment();
|
||||
}
|
||||
|
@ -250,6 +250,11 @@ public:
|
||||
* expectation that scrolling is going to happen.
|
||||
*/
|
||||
virtual bool IsScrollingActive() = 0;
|
||||
/**
|
||||
* Returns true if the scrollframe is currently processing an async
|
||||
* or smooth scroll.
|
||||
*/
|
||||
virtual bool IsProcessingAsyncScroll() = 0;
|
||||
/**
|
||||
* Call this when the layer(s) induced by active scrolling are being
|
||||
* completely redrawn.
|
||||
|
@ -92,7 +92,9 @@ ScrollFrameTo(nsIScrollableFrame* aFrame, const CSSPoint& aPoint)
|
||||
return CSSPoint();
|
||||
}
|
||||
|
||||
// If the scrollable frame got a scroll request from something other than us
|
||||
// If the scrollable frame is currently in the middle of an async or smooth
|
||||
// scroll then we don't want to interrupt it (see bug 961280).
|
||||
// Also if the scrollable frame got a scroll request from something other than us
|
||||
// since the last layers update, then we don't want to push our scroll request
|
||||
// because we'll clobber that one, which is bad.
|
||||
// Note that content may have just finished sending a layers update with a scroll
|
||||
@ -101,7 +103,8 @@ ScrollFrameTo(nsIScrollableFrame* aFrame, const CSSPoint& aPoint)
|
||||
// scroll offset. This is unavoidable because of the async communication between
|
||||
// APZ and content; however the code in NotifyLayersUpdated should reissue a new
|
||||
// repaint request to bring everything back into sync.
|
||||
if (!aFrame->OriginOfLastScroll() || aFrame->OriginOfLastScroll() == nsGkAtoms::apz) {
|
||||
if (!aFrame->IsProcessingAsyncScroll() &&
|
||||
(!aFrame->OriginOfLastScroll() || aFrame->OriginOfLastScroll() == nsGkAtoms::apz)) {
|
||||
aFrame->ScrollToCSSPixelsApproximate(aPoint, nsGkAtoms::apz);
|
||||
}
|
||||
// Return the final scroll position after setting it so that anything that relies
|
||||
|
Loading…
x
Reference in New Issue
Block a user