Bug 1016535 - Always give overlay scrollbars their own layers, even for subframes. r=roc

This commit is contained in:
Markus Stange 2014-05-28 11:46:10 +02:00
parent cd2a1df60b
commit d75b4bfa87
2 changed files with 9 additions and 21 deletions

View File

@ -2183,7 +2183,7 @@ void
ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
bool& aCreateLayer,
bool aCreateLayer,
bool aPositioned)
{
nsITheme* theme = mOuter->PresContext()->GetTheme();
@ -2438,9 +2438,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
// We put scrollbars in their own layers when this is the root scroll
// frame and we are a toplevel content document. In this situation, the
// scrollbar(s) would normally be assigned their own layer anyway, since
// We put non-overlay scrollbars in their own layers when this is the root
// scroll frame and we are a toplevel content document. In this situation,
// the scrollbar(s) would normally be assigned their own layer anyway, since
// they're not scrolled with the rest of the document. But when both
// scrollbars are visible, the layer's visible rectangle would be the size
// of the viewport, so most layer implementations would create a layer buffer
@ -2475,16 +2475,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame,
aDirtyRect, aLists);
#ifdef MOZ_WIDGET_GONK
// TODO: only layerize the overlay scrollbars if this scrollframe can be
// panned asynchronously. For now just always layerize on B2G because.
// that's where we want the layerized scrollbars
createLayersForScrollbars = true;
#endif
if (addScrollBars) {
// Add overlay scrollbars.
AppendScrollPartsTo(aBuilder, aDirtyRect, aLists, createLayersForScrollbars,
true);
AppendScrollPartsTo(aBuilder, aDirtyRect, aLists, true, true);
}
return;
@ -2685,14 +2678,9 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
scrolledContent.BorderBackground()->AppendNewToBottom(layerItem);
}
// Now display overlay scrollbars and the resizer, if we have one.
#ifdef MOZ_WIDGET_GONK
// TODO: only layerize the overlay scrollbars if this scrollframe can be
// panned asynchronously. For now just always layerize on B2G because.
// that's where we want the layerized scrollbars
createLayersForScrollbars = true;
#endif
AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent,
createLayersForScrollbars, true);
// Always create layers for these, so that we don't create a giant layer
// covering the whole scrollport if both scrollbars are visible.
AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent, true, true);
scrolledContent.MoveTo(aLists);
}

View File

@ -68,7 +68,7 @@ public:
void AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists,
bool& aCreateLayer,
bool aCreateLayer,
bool aPositioned);
bool GetBorderRadii(const nsSize& aFrameSize, const nsSize& aBorderArea,