Bug 1080205. Part 1: Don't add clip rects to async-scrolled layers for root scrollframes, since the FrameMetrics to scroll those layers will be set on a ContainerLayer parent. r=tn

--HG--
extra : rebase_source : b8fc0e3c97d5be50443734ed80caafabd37cf1a3
This commit is contained in:
Robert O'Callahan 2014-10-28 17:34:58 +13:00
Родитель 6b0fb73717
Коммит ba470b0a04
2 изменённых файлов: 9 добавлений и 1 удалений

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

@ -2800,6 +2800,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mOuter->PresContext()->IsRootContentDocument();
if (aBuilder->GetIgnoreScrollFrame() == mOuter || IsIgnoringViewportClipping()) {
mAddClipRectToLayer = false;
// If we are a root scroll frame that has a display port we want to add
// scrollbars, they will be children of the scrollable layer, but they get
@ -2829,6 +2830,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return;
}
mAddClipRectToLayer =
!(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden());
// Overflow clipping can never clip frames outside our subtree, so there
// is no need to worry about whether we are a moving frame that might clip
// non-moving frames.
@ -3049,7 +3053,9 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer,
{
nsRect scrollport = mScrollPort +
mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
if (!(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden())) {
// Root scrollframes have FrameMetrics and clipping on their container layers,
// so don't also apply clipping here.
if (mAddClipRectToLayer) {
*aClipRect = scrollport;
}

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

@ -450,6 +450,8 @@ public:
// If true, the layer should always be active because we always build a
// scrollable layer. Used for asynchronous scrolling.
bool mShouldBuildScrollableLayer:1;
// If true, add clipping in ScrollFrameHelper::ComputeFrameMetrics.
bool mAddClipRectToLayer:1;
// True if this frame has been scrolled at least once
bool mHasBeenScrolled:1;