Bug 1228357 - When saving/restoring a scrollframe's state, only save/restore resolution for the root scrollframe. r=roc

This commit is contained in:
Kartikaya Gupta 2015-11-26 21:25:53 -05:00
parent f19e775073
commit 79db8a28eb

View File

@ -5359,9 +5359,12 @@ ScrollFrameHelper::SaveState() const
pt = mRestorePos;
}
state->SetScrollState(pt);
nsIPresShell* shell = mOuter->PresContext()->PresShell();
state->SetResolution(shell->GetResolution());
state->SetScaleToResolution(shell->ScaleToResolution());
if (mIsRoot) {
// Only save resolution properties for root scroll frames
nsIPresShell* shell = mOuter->PresContext()->PresShell();
state->SetResolution(shell->GetResolution());
state->SetScaleToResolution(shell->ScaleToResolution());
}
return state;
}
@ -5372,8 +5375,9 @@ ScrollFrameHelper::RestoreState(nsPresState* aState)
mDidHistoryRestore = true;
mLastPos = mScrolledFrame ? GetLogicalScrollPosition() : nsPoint(0,0);
// Scaling-to-resolution should only be used on root scroll frames.
MOZ_ASSERT(mIsRoot || !aState->GetScaleToResolution());
// Resolution properties should only exist on root scroll frames.
MOZ_ASSERT(mIsRoot || (!aState->GetScaleToResolution() &&
aState->GetResolution() == 1.0));
if (mIsRoot) {
nsIPresShell* presShell = mOuter->PresContext()->PresShell();