Bug 1220114. Part 1. Change ScrollFrameHelper::DecideScrollableLayer to recompute the current animated geometry root any time mWillBuildScrollableLayer changes in addition to when usingDisplayPort changes. r=mstange

Changes in either one can result in AGRs being created or removed (although nothing removes them at this point in time).
This commit is contained in:
Timothy Nikkel 2015-11-06 17:32:03 -06:00
Родитель 4c7afc9339
Коммит 0570e20dc3
1 изменённых файлов: 11 добавлений и 7 удалений

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

@ -3160,10 +3160,14 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
nsRect* aDirtyRect,
bool aAllowCreateDisplayPort)
{
// Save and check if this changes so we can recompute the current agr.
bool oldWillBuildScrollableLayer = mWillBuildScrollableLayer;
bool wasUsingDisplayPort = false;
bool usingDisplayPort = false;
nsIContent* content = mOuter->GetContent();
if (aBuilder->IsPaintingToWindow()) {
bool wasUsingDisplayPort = nsLayoutUtils::GetDisplayPort(content);
wasUsingDisplayPort = nsLayoutUtils::GetDisplayPort(content);
nsRect displayportBase = *aDirtyRect;
nsPresContext* pc = mOuter->PresContext();
@ -3188,12 +3192,6 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
// Override the dirty rectangle if the displayport has been set.
if (usingDisplayPort) {
*aDirtyRect = displayPort;
// The cached animated geometry root for the display builder is out of
// date if we just introduced a new animated geometry root.
if (!wasUsingDisplayPort) {
aBuilder->RecomputeCurrentAnimatedGeometryRoot();
}
}
}
@ -3205,6 +3203,12 @@ ScrollFrameHelper::DecideScrollableLayer(nsDisplayListBuilder* aBuilder,
// so that APZ can implement scroll grabbing.
mWillBuildScrollableLayer = usingDisplayPort || nsContentUtils::HasScrollgrab(content);
// The cached animated geometry root for the display builder is out of
// date if we just introduced a new animated geometry root.
if ((oldWillBuildScrollableLayer != mWillBuildScrollableLayer) || (wasUsingDisplayPort != usingDisplayPort)) {
aBuilder->RecomputeCurrentAnimatedGeometryRoot();
}
if (gfxPrefs::LayoutUseContainersForRootFrames() && mWillBuildScrollableLayer && mIsRoot) {
mIsScrollableLayerInRootContainer = true;
}