зеркало из https://github.com/mozilla/gecko-dev.git
Bug 988511 - Allow fixed position items to fully occlude displayport items. r=tn
We don't allow fixed position items to occlude display-ports, but we should if they fully occlude the scroll-position scroll clamping port of the displayport frame.
This commit is contained in:
Родитель
df0eb6e634
Коммит
d0ad5d7a62
|
@ -1181,16 +1181,30 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder,
|
|||
// is that the fixed pos content is in a child document, in which it
|
||||
// would scroll with the rest of the content.
|
||||
bool occlude = true;
|
||||
nsIPresShell* presShell = nullptr;
|
||||
if (aDisplayPortFrame && item->IsInFixedPos()) {
|
||||
if (item->Frame()->PresContext() == aDisplayPortFrame->PresContext()) {
|
||||
occlude = false;
|
||||
presShell = aDisplayPortFrame->PresContext()->PresShell();
|
||||
}
|
||||
}
|
||||
|
||||
nsRegion opaque = TreatAsOpaque(item, aBuilder);
|
||||
if (occlude) {
|
||||
nsRegion opaque = TreatAsOpaque(item, aBuilder);
|
||||
// Subtract opaque item from the visible region
|
||||
aBuilder->SubtractFromVisibleRegion(aVisibleRegion, opaque);
|
||||
} else if (presShell &&
|
||||
presShell->IsScrollPositionClampingScrollPortSizeSet() &&
|
||||
!opaque.IsEmpty()) {
|
||||
// We make an exception if the fixed position item would fully occlude
|
||||
// the scroll position clamping scroll-port. In that case, it's very
|
||||
// unlikely that it will become visible via async scrolling, so we let
|
||||
// it occlude.
|
||||
nsRect scrollClampingScrollPort(nsPoint(0, 0),
|
||||
presShell->GetScrollPositionClampingScrollPortSize());
|
||||
if (opaque.Contains(scrollClampingScrollPort)) {
|
||||
aVisibleRegion->SetEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
if (aBuilder->NeedToForceTransparentSurfaceForItem(item) ||
|
||||
|
|
Загрузка…
Ссылка в новой задаче