Bug 1050096. Clip scrollparts to the viewport for root scrollframes. r=tnikkel

This commit is contained in:
Robert O'Callahan 2014-08-09 01:00:53 +12:00
Родитель 861267f74f
Коммит f4028459f4
1 изменённых файлов: 12 добавлений и 0 удалений

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

@ -2388,6 +2388,9 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
scrollParts.AppendElement(kid);
}
if (scrollParts.IsEmpty()) {
return;
}
mozilla::layers::FrameMetrics::ViewID scrollTargetId = IsScrollingActive()
? nsLayoutUtils::FindOrCreateIDFor(mScrolledFrame->GetContent())
@ -2395,6 +2398,15 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
scrollParts.Sort(HoveredStateComparator());
DisplayListClipState::AutoSaveRestore clipState(aBuilder);
// Don't let scrollparts extent outside our frame's border-box, if these are
// viewport scrollbars. They would create layerization problems. This wouldn't
// normally be an issue but themes can add overflow areas to scrollbar parts.
if (mIsRoot) {
clipState.ClipContentDescendants(
mOuter->GetRectRelativeToSelf() + aBuilder->ToReferenceFrame(mOuter));
}
for (uint32_t i = 0; i < scrollParts.Length(); ++i) {
uint32_t flags = 0;
if (scrollParts[i] == mVScrollbarBox) {