From 3389fb77b93776a153f5b183f0953802470d5c00 Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Tue, 22 Jul 2014 15:37:28 -0500 Subject: [PATCH] Bug 1041510. Now that we merge and flatten display items bottom to top (instead of the reverse) move the scroll info layer to be on top of the other scrolled content so that it is still processed last. r=roc --- layout/generic/nsGfxScrollFrame.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index 7dc6d967f35b..6e48cae9c318 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2641,7 +2641,13 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder, // metadata about this scroll box to the compositor process. nsDisplayScrollInfoLayer* layerItem = new (aBuilder) nsDisplayScrollInfoLayer( aBuilder, mScrolledFrame, mOuter); - scrolledContent.BorderBackground()->AppendNewToBottom(layerItem); + nsDisplayList* positionedDescendants = scrolledContent.PositionedDescendants(); + if (!positionedDescendants->IsEmpty()) { + layerItem->SetOverrideZIndex(MaxZIndexInList(positionedDescendants, aBuilder)); + positionedDescendants->AppendNewToTop(layerItem); + } else { + aLists.Outlines()->AppendNewToTop(layerItem); + } } // Now display overlay scrollbars and the resizer, if we have one. AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent,