diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index b7a834d94d2..b82bbe448b9 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -1323,6 +1323,19 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder, return mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, newDirty, aLists); } + // Now display the scrollbars and scrollcorner. These parts are drawn + // in the border-background layer, on top of our own background and + // borders and underneath borders and backgrounds of later elements + // in the tree. + nsIFrame* kid = mOuter->GetFirstChild(nsnull); + while (kid) { + if (kid != mScrolledFrame) { + rv = mOuter->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, aLists); + NS_ENSURE_SUCCESS(rv, rv); + } + kid = kid->GetNextSibling(); + } + // Overflow clipping can never clip frames outside our subtree, so there // is no need to worry about whether we are a moving frame that might clip // non-moving frames. @@ -1347,18 +1360,6 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder, rv = mOuter->OverflowClip(aBuilder, set, aLists, clip, PR_TRUE, mIsRoot); NS_ENSURE_SUCCESS(rv, rv); - // Now display the scrollbars and scrollcorner - nsIFrame* kid = mOuter->GetFirstChild(nsnull); - // Put each child's background directly onto the content list - nsDisplayListSet scrollbarSet(aLists, aLists.Content()); - while (kid) { - if (kid != mScrolledFrame) { - rv = mOuter->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, scrollbarSet, - nsIFrame::DISPLAY_CHILD_FORCE_PSEUDO_STACKING_CONTEXT); - NS_ENSURE_SUCCESS(rv, rv); - } - kid = kid->GetNextSibling(); - } return NS_OK; } diff --git a/layout/reftests/z-index/480053-1-ref.html b/layout/reftests/z-index/480053-1-ref.html new file mode 100644 index 00000000000..c6c8782a593 --- /dev/null +++ b/layout/reftests/z-index/480053-1-ref.html @@ -0,0 +1,7 @@ + + + +
+
+ + diff --git a/layout/reftests/z-index/480053-1.html b/layout/reftests/z-index/480053-1.html new file mode 100644 index 00000000000..03ef8b815fd --- /dev/null +++ b/layout/reftests/z-index/480053-1.html @@ -0,0 +1,7 @@ + + + +
+
+ + diff --git a/layout/reftests/z-index/reftest.list b/layout/reftests/z-index/reftest.list index 20c00569b5c..8c7fd4b4489 100644 --- a/layout/reftests/z-index/reftest.list +++ b/layout/reftests/z-index/reftest.list @@ -1 +1,2 @@ +== 480053-1.html 480053-1-ref.html == z-index-1.html z-index-1-ref.html