Bug 929915. Fix IsScrollingActive on scroll frames to only be true if we actually build a scrollable layer. r=roc

This commit is contained in:
Timothy Nikkel 2013-11-01 22:47:21 -05:00
Родитель e6e5c2e310
Коммит 1137aa9567
2 изменённых файлов: 11 добавлений и 16 удалений

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

@ -1560,7 +1560,7 @@ nsGfxScrollFrameInner::nsGfxScrollFrameInner(nsContainerFrame* aOuter,
, mMayHaveDirtyFixedChildren(false)
, mUpdateScrollbarAttributes(false)
, mCollapsedResizer(false)
, mShouldBuildLayer(false)
, mShouldBuildScrollableLayer(false)
, mHasBeenScrolled(false)
{
mScrollingActive = IsAlwaysActive();
@ -2131,12 +2131,6 @@ nsGfxScrollFrameInner::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
}
}
bool
nsGfxScrollFrameInner::ShouldBuildLayer() const
{
return mShouldBuildLayer;
}
class ScrollLayerWrapper : public nsDisplayWrapper
{
public:
@ -2343,8 +2337,9 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// When a displayport is being used, force building of a layer so that
// CompositorParent can always find the scrollable layer for the root content
// document.
bool shouldBuildLayer = false;
if (usingDisplayport) {
mShouldBuildLayer = true;
shouldBuildLayer = true;
} else {
nsRect scrollRange = GetScrollRange();
ScrollbarStyles styles = GetScrollbarStylesFromFrame();
@ -2359,18 +2354,20 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
wantSubAPZC = true;
}
#endif
mShouldBuildLayer =
shouldBuildLayer =
wantSubAPZC &&
hasScrollableOverflow &&
(!mIsRoot || !mOuter->PresContext()->IsRootContentDocument());
}
if (ShouldBuildLayer()) {
mShouldBuildScrollableLayer = false;
if (shouldBuildLayer) {
// ScrollLayerWrapper must always be created because it initializes the
// scroll layer count. The display lists depend on this.
ScrollLayerWrapper wrapper(mOuter, mScrolledFrame);
if (usingDisplayport) {
mShouldBuildScrollableLayer = true;
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
// For root scrollframes in documents where the CSS viewport has been

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

@ -65,8 +65,6 @@ public:
void PostOverflowEvent();
void Destroy();
bool ShouldBuildLayer() const;
void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists);
@ -268,7 +266,7 @@ public:
nscoord GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState);
bool IsLTR() const;
bool IsScrollbarOnRight() const;
bool IsScrollingActive() const { return mScrollingActive || ShouldBuildLayer(); }
bool IsScrollingActive() const { return mScrollingActive || mShouldBuildScrollableLayer; }
void ResetScrollPositionForLayerPixelAlignment()
{
mScrollPosForLayerPixelAlignment = GetScrollPosition();
@ -386,9 +384,9 @@ public:
// If true, the resizer is collapsed and not displayed
bool mCollapsedResizer:1;
// If true, the layer should always be active because we always build a layer.
// Used for asynchronous scrolling.
bool mShouldBuildLayer:1;
// If true, the layer should always be active because we always build a
// scrollable layer. Used for asynchronous scrolling.
bool mShouldBuildScrollableLayer:1;
// True if this frame has been scrolled at least once
bool mHasBeenScrolled:1;