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: GTy9BmVVZ9q

--HG--
extra : rebase_source : be321091d6b5fe4b66738f2deeffbcfa6af0b521
This commit is contained in:
Kartikaya Gupta 2017-11-08 20:47:18 -05:00
Родитель 7b31712d93
Коммит 0e18ce302a
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->PresContext()->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;