Bug 1415225 - Stop setting the EventRegionsOverride flag on in-process subdocument layers. r=botond

The mechanics of this change is fairly straightforward - instead of setting the
override on the layer corresponding to the in-process subdocument, we just set
the flag on the display list builder; that flag is already checked when building
the layer event regions for descendant nsIFrames.

As a side-effect, we also don't need to force a layer for in-process subdocuments
just because they have document-level APZ-aware listeners. One of reasons we were
doing so before was so that we would have a layer to stash the override flags on
but now we don't need that any more.

Note that out-of-process subdocuments are not affected; for those cases
the nsSubDocumentFrame delegates BuildDisplayList to
RenderFrameParent/nsDisplayRemote, which will still set the overrides on
the RefLayer that is created.

MozReview-Commit-ID: DZWglE4e62p

--HG--
extra : rebase_source : 78494a5cbfd0dfecb5f2262e5c1b3dc5367c5d55
This commit is contained in:
Kartikaya Gupta 2017-11-09 09:03:51 -05:00
Родитель d5cf7941e2
Коммит 028fa48259
3 изменённых файлов: 5 добавлений и 25 удалений

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

@ -447,12 +447,6 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
needsOwnLayer = true;
}
if (!needsOwnLayer && aBuilder->IsBuildingLayerEventRegions() &&
nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(presShell))
{
needsOwnLayer = true;
}
if (aBuilder->IsRetainingDisplayList()) {
// The value of needsOwnLayer can change between builds without
// an invalidation recorded for this frame (like if the root
@ -505,7 +499,11 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
? nsLayoutUtils::FindOrCreateIDFor(rootScrollFrame->GetContent())
: aBuilder->GetCurrentScrollParentId());
aBuilder->SetAncestorHasApzAwareEventHandler(false);
bool hasDocumentLevelListenersForApzAwareEvents =
aBuilder->IsBuildingLayerEventRegions() &&
nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(presShell);
aBuilder->SetAncestorHasApzAwareEventHandler(hasDocumentLevelListenersForApzAwareEvents);
subdocRootFrame->
BuildDisplayListForStackingContext(aBuilder, &childItems);
}

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

@ -6861,9 +6861,6 @@ nsDisplaySubDocument::nsDisplaySubDocument(nsDisplayListBuilder* aBuilder,
, mSubDocFrame(aSubDocFrame)
{
MOZ_COUNT_CTOR(nsDisplaySubDocument);
mForceDispatchToContentRegion =
aBuilder->IsBuildingLayerEventRegions() &&
nsLayoutUtils::HasDocumentLevelListenersForApzAwareEvents(aFrame->PresShell());
// The SubDocument display item is conceptually outside the viewport frame,
// so in cases where the viewport frame is an AGR, the SubDocument's AGR
@ -6879,17 +6876,6 @@ nsDisplaySubDocument::~nsDisplaySubDocument() {
}
#endif
already_AddRefed<Layer>
nsDisplaySubDocument::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) {
RefPtr<Layer> layer = nsDisplayOwnLayer::BuildLayer(aBuilder, aManager, aContainerParameters);
layer->AsContainerLayer()->SetEventRegionsOverride(mForceDispatchToContentRegion
? EventRegionsOverride::ForceDispatchToContent
: EventRegionsOverride::NoOverride);
return layer.forget();
}
UniquePtr<ScrollMetadata>
nsDisplaySubDocument::ComputeScrollMetadata(LayerManager* aLayerManager,
const ContainerLayerParameters& aContainerParameters)

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

@ -5111,10 +5111,6 @@ public:
virtual ~nsDisplaySubDocument();
#endif
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) override;
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
bool* aSnap) const override;