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:
Timothy Nikkel 2014-04-06 22:00:01 -05:00
Родитель 605fb137f9
Коммит e72d6d5bf3
4 изменённых файлов: 48 добавлений и 4 удалений

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

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

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

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

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

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