mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
cb3a49ad4e
commit
232c0e9e10
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
if (occlude) {
|
||||
nsRegion opaque = TreatAsOpaque(item, aBuilder);
|
||||
if (occlude) {
|
||||
// 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) ||
|
||||
|
Loading…
Reference in New Issue
Block a user