Bug 480053 - Fix z-ordering of scrollbars to match Webkit/IE8. r+sr=dbaron

This commit is contained in:
Robert O'Callahan 2009-02-26 20:00:36 +13:00
parent 3c011596d4
commit 12706db074
4 changed files with 28 additions and 12 deletions

View File

@ -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;
}

View File

@ -0,0 +1,7 @@
<!DOCTYPE HTML>
<html>
<body>
<div style="overflow:scroll; width:300px; height:100px; background-color:lime;"></div>
<div style="background-color:yellow; width:300px; height:100px; margin-top:-50px; position:relative; z-index:1;"></div>
</body>
</html>

View File

@ -0,0 +1,7 @@
<!DOCTYPE HTML>
<html>
<body>
<div style="overflow:scroll; width:300px; height:100px; background-color:lime;"></div>
<div style="background-color:yellow; width:300px; height:100px; margin-top:-50px"></div>
</body>
</html>

View File

@ -1 +1,2 @@
== 480053-1.html 480053-1-ref.html
== z-index-1.html z-index-1-ref.html