Bug 928441 - Don't clip to the scrollport on root scrollframes if the CSS viewport has been overridden. r=tn,roc

This commit is contained in:
Kartikaya Gupta 2013-10-24 18:31:26 +02:00
parent 125bd727f4
commit 0ee526caa4

View File

@ -2372,12 +2372,21 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (usingDisplayport) {
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
nsRect clip = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
if (mClipAllDescendants) {
clipState.ClipContentDescendants(clip);
} else {
clipState.ClipContainingBlockDescendants(clip);
// For root scrollframes in documents where the CSS viewport has been
// modified, the CSS viewport no longer corresponds to what is visible,
// so we don't want to clip the content to it. For root scrollframes
// in documents where the CSS viewport is NOT modified, the mScrollPort
// is the same as the CSS viewport, modulo scrollbars.
if (!(mIsRoot && mOuter->PresContext()->PresShell()->GetIsViewportOverridden())) {
nsRect clip = mScrollPort + aBuilder->ToReferenceFrame(mOuter);
if (mClipAllDescendants) {
clipState.ClipContentDescendants(clip);
} else {
clipState.ClipContainingBlockDescendants(clip);
}
}
// Once a displayport is set, assume that scrolling needs to be fast
// so create a layer with all the content inside. The compositor
// process will be able to scroll the content asynchronously.