Bug 1018309 - Make the forced scrollbar layerization from bug 1016535 really only kick in for actual overlay scrollbars. r=roc

--HG--
extra : rebase_source : 525c4e242f28af85ad7c0f6cae8f2f4083b01d7d
This commit is contained in:
Markus Stange 2014-06-03 14:47:27 +02:00
Родитель e9d8d2adf4
Коммит c26d84b83e
1 изменённых файлов: 12 добавлений и 8 удалений

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

@ -2196,9 +2196,8 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
scrollParts.AppendElement(kid); scrollParts.AppendElement(kid);
} }
mozilla::layers::FrameMetrics::ViewID scrollTargetId = aCreateLayer mozilla::layers::FrameMetrics::ViewID scrollTargetId =
? nsLayoutUtils::FindOrCreateIDFor(mScrolledFrame->GetContent()) nsLayoutUtils::FindOrCreateIDFor(mScrolledFrame->GetContent());
: mozilla::layers::FrameMetrics::NULL_SCROLL_ID;
scrollParts.Sort(HoveredStateComparator()); scrollParts.Sort(HoveredStateComparator());
@ -2216,11 +2215,16 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder,
flags |= nsDisplayOwnLayer::HORIZONTAL_SCROLLBAR; flags |= nsDisplayOwnLayer::HORIZONTAL_SCROLLBAR;
} }
// Always create layers for overlay scrollbars so that we don't create a
// giant layer covering the whole scrollport if both scrollbars are visible.
bool isOverlayScrollbar = (flags != 0) && overlayScrollbars;
bool createLayer = aCreateLayer || isOverlayScrollbar;
// DISPLAY_CHILD_FORCE_STACKING_CONTEXT put everything into // DISPLAY_CHILD_FORCE_STACKING_CONTEXT put everything into
// partList.PositionedDescendants(). // partList.PositionedDescendants().
::AppendToTop(aBuilder, aLists, ::AppendToTop(aBuilder, aLists,
partList.PositionedDescendants(), scrollParts[i], partList.PositionedDescendants(), scrollParts[i],
aCreateLayer, flags, scrollTargetId, aPositioned); createLayer, flags, scrollTargetId, aPositioned);
} }
} }
@ -2469,7 +2473,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (addScrollBars) { if (addScrollBars) {
// Add overlay scrollbars. // Add overlay scrollbars.
AppendScrollPartsTo(aBuilder, aDirtyRect, aLists, true, true); AppendScrollPartsTo(aBuilder, aDirtyRect, aLists,
createLayersForScrollbars, true);
} }
return; return;
@ -2661,9 +2666,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
scrolledContent.BorderBackground()->AppendNewToBottom(layerItem); scrolledContent.BorderBackground()->AppendNewToBottom(layerItem);
} }
// Now display overlay scrollbars and the resizer, if we have one. // Now display overlay scrollbars and the resizer, if we have one.
// Always create layers for these, so that we don't create a giant layer AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent,
// covering the whole scrollport if both scrollbars are visible. createLayersForScrollbars, true);
AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent, true, true);
scrolledContent.MoveTo(aLists); scrolledContent.MoveTo(aLists);
} }