Bug 1892341 - Minor clean-up to subdocument display list building. r=tnikkel,layout-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D207932
This commit is contained in:
Emilio Cobos Álvarez 2024-04-18 22:08:31 +00:00
parent 889c75a804
commit d3b59ee280

View file

@ -322,30 +322,29 @@ void nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
return;
}
nsFrameLoader* frameLoader = FrameLoader();
bool isRemoteFrame = frameLoader && frameLoader->IsRemoteFrame();
// If we are pointer-events:none then we don't need to HitTest background
const bool pointerEventsNone =
Style()->PointerEvents() == StylePointerEvents::None;
if (!aBuilder->IsForEventDelivery() || !pointerEventsNone) {
nsDisplayListCollection decorations(aBuilder);
DisplayBorderBackgroundOutline(aBuilder, decorations);
if (isRemoteFrame) {
// Wrap background colors of <iframe>s with remote subdocuments in their
// own layer so we generate a ColorLayer. This is helpful for optimizing
// compositing; we can skip compositing the ColorLayer when the
// remote content is opaque.
WrapBackgroundColorInOwnLayer(aBuilder, this,
decorations.BorderBackground());
}
decorations.MoveTo(aLists);
}
if (aBuilder->IsForEventDelivery() && pointerEventsNone) {
// If we are pointer-events:none then we don't need to HitTest background or
// anything else.
return;
}
nsFrameLoader* frameLoader = FrameLoader();
const bool isRemoteFrame = frameLoader && frameLoader->IsRemoteFrame();
nsDisplayListCollection decorations(aBuilder);
DisplayBorderBackgroundOutline(aBuilder, decorations);
if (isRemoteFrame) {
// Wrap background colors of <iframe>s with remote subdocuments in their
// own layer so we generate a ColorLayer. This is helpful for optimizing
// compositing; we can skip compositing the ColorLayer when the
// remote content is opaque.
WrapBackgroundColorInOwnLayer(aBuilder, this,
decorations.BorderBackground());
}
decorations.MoveTo(aLists);
if (HidesContent()) {
return;
}