Bug 1148022 - When frame metrics are attached to the container layer of the root scroll frame, make sure that its scroll frame is active. r=tn

This commit is contained in:
Markus Stange 2015-04-02 14:28:42 -04:00
parent 3f81e3d416
commit 8c641f72cf
2 changed files with 16 additions and 1 deletions

View File

@ -1937,6 +1937,7 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter,
, mHasBeenScrolledRecently(false)
, mCollapsedResizer(false)
, mShouldBuildScrollableLayer(false)
, mIsScrollableLayerInRootContainer(false)
, mHasBeenScrolled(false)
, mIsResolutionSet(false)
, mIgnoreMomentumScroll(false)
@ -2940,6 +2941,14 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// adjusted by the APZC automatically.
bool usingDisplayPort = aBuilder->IsPaintingToWindow() &&
nsLayoutUtils::GetDisplayPort(mOuter->GetContent());
if (usingDisplayPort) {
// There is a display port for this frame, so we want to appear as having
// active scrolling, so that animated geometry roots are assigned correctly.
mShouldBuildScrollableLayer = true;
mIsScrollableLayerInRootContainer = true;
}
bool addScrollBars = mIsRoot && usingDisplayPort && !aBuilder->IsForEventDelivery();
if (addScrollBars) {
@ -3221,7 +3230,7 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer,
*aClipRect = scrollport;
}
if (!mShouldBuildScrollableLayer) {
if (!mShouldBuildScrollableLayer || mIsScrollableLayerInRootContainer) {
return;
}

View File

@ -500,6 +500,12 @@ public:
// scrollable layer. Used for asynchronous scrolling.
bool mShouldBuildScrollableLayer:1;
// Whether we are the root scroll frame that is used for containerful
// scrolling with a display port. If true, the scrollable frame
// shouldn't attach frame metrics to its layers because the container
// will already have the necessary frame metrics.
bool mIsScrollableLayerInRootContainer:1;
// If true, add clipping in ScrollFrameHelper::ComputeFrameMetrics.
bool mAddClipRectToLayer:1;