Bug 1511358 - Don't include elements with z-index<0 when looking for the max z-index in a display list. r=miko

This restores the previous behaviour (where a result < 0 was ignored), since using a negative value means we place our overlay scrollbar/resizer behind non-positioned content.

Differential Revision: https://phabricator.services.mozilla.com/D20212

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matt Woodrow 2019-02-19 13:38:08 +00:00
Родитель d0bad17fb2
Коммит 0bef7abebb
1 изменённых файлов: 6 добавлений и 2 удалений

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

@ -2939,10 +2939,14 @@ static Maybe<int32_t> MaxZIndexInList(nsDisplayList* aList,
Maybe<int32_t> maxZIndex = Nothing();
for (nsDisplayItem* item = aList->GetBottom(); item;
item = item->GetAbove()) {
int32_t zIndex = item->ZIndex();
if (zIndex < 0) {
continue;
}
if (!maxZIndex) {
maxZIndex = Some(item->ZIndex());
maxZIndex = Some(zIndex);
} else {
maxZIndex = Some(std::max(maxZIndex.value(), item->ZIndex()));
maxZIndex = Some(std::max(maxZIndex.value(), zIndex));
}
}
return maxZIndex;