mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 987680. Overlay scrollbars should be placed on top of content. r=roc
Bug 926292 accidentally put them in the background list if there were no positioned descendents that they needed to be on top of it (because this was where non-overlay scrollbars went, which never made sense). If there are no positioned descendents overlay scrollbars should go on the top-most non-positioned list, which is outlines for the current implementation.
This commit is contained in:
parent
605fb137f9
commit
e72d6d5bf3
@ -2128,13 +2128,17 @@ AppendToTop(nsDisplayListBuilder* aBuilder, const nsDisplayListSet& aLists,
|
||||
aFlags, aScrollTargetId) :
|
||||
new (aBuilder) nsDisplayWrapList(aBuilder, aSourceFrame, aSource);
|
||||
|
||||
nsDisplayList* positionedDescendants = aLists.PositionedDescendants();
|
||||
if (aPositioned && !positionedDescendants->IsEmpty()) {
|
||||
if (aPositioned) {
|
||||
// We want overlay scrollbars to always be on top of the scrolled content,
|
||||
// but we don't want them to unnecessarily cover overlapping elements from
|
||||
// outside our scroll frame.
|
||||
newItem->SetOverrideZIndex(MaxZIndexInList(positionedDescendants, aBuilder));
|
||||
positionedDescendants->AppendNewToTop(newItem);
|
||||
nsDisplayList* positionedDescendants = aLists.PositionedDescendants();
|
||||
if (!positionedDescendants->IsEmpty()) {
|
||||
newItem->SetOverrideZIndex(MaxZIndexInList(positionedDescendants, aBuilder));
|
||||
positionedDescendants->AppendNewToTop(newItem);
|
||||
} else {
|
||||
aLists.Outlines()->AppendNewToTop(newItem);
|
||||
}
|
||||
} else {
|
||||
aLists.BorderBackground()->AppendNewToTop(newItem);
|
||||
}
|
||||
|
20
layout/reftests/bugs/987680-1-ref.html
Normal file
20
layout/reftests/bugs/987680-1-ref.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.container {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
overflow: scroll;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div style="width: 10px; height: 10px; left: 0px; top: 60px; background: white; position: absolute; z-index: 1;"></div>
|
||||
<div style="background: green; height: 40px;"></div>
|
||||
<div style="height: 300px;"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
19
layout/reftests/bugs/987680-1.html
Normal file
19
layout/reftests/bugs/987680-1.html
Normal file
@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
.container {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
overflow: scroll;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div style="background: green; height: 40px;"></div>
|
||||
<div style="height: 300px;"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1804,3 +1804,4 @@ skip-if(Android) == 966510-2.html 966510-2-ref.html # same as above
|
||||
== 983084-2.html 983084-2-ref.html
|
||||
== 983084-3.html 983084-1-ref.html
|
||||
== 983691-1.html 983691-ref.html
|
||||
== 987680-1.html 987680-1-ref.html
|
||||
|
Loading…
Reference in New Issue
Block a user