Bug 1220114. Part 2. If a scroll frame is forced to layerize because of an active descendant scroll frame then set a displayport on the ancestor scroll frame so that next paint we don't have to force layerization after the fact and we can do a fully proper paint. r=mstange

This commit is contained in:
Timothy Nikkel 2015-11-06 17:32:03 -06:00
Родитель 0570e20dc3
Коммит cf2a0eeaa4
1 изменённых файлов: 13 добавлений и 6 удалений

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

@ -3098,13 +3098,20 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
//
// This is not compatible when using containes for root scrollframes.
MOZ_ASSERT(couldBuildLayer && mScrolledFrame->GetContent());
bool needToRecomputeAGR = false;
if (!mWillBuildScrollableLayer) {
needToRecomputeAGR = true;
}
mWillBuildScrollableLayer = true;
if (needToRecomputeAGR) {
aBuilder->RecomputeCurrentAnimatedGeometryRoot();
// Set a displayport so next paint we don't have to force layerization
// after the fact.
nsLayoutUtils::SetDisplayPortMargins(mOuter->GetContent(),
mOuter->PresContext()->PresShell(),
ScreenMargin(),
0,
nsLayoutUtils::RepaintMode::DoNotRepaint);
// Call DecideScrollableLayer to recompute mWillBuildScrollableLayer and
// recompute the current animated geometry root if needed.
// It's too late to change the dirty rect so pass a copy.
nsRect copyOfDirtyRect = dirtyRect;
Unused << DecideScrollableLayer(aBuilder, &copyOfDirtyRect,
/* aAllowCreateDisplayPort = */ false);
}
}
}