Bug 1871751. Avoid AsyncPanZoomEnabled call in MaybeCreateDisplayPortInFirstScrollFrameEncountered. r=layout-reviewers,emilio

The return value of nsLayoutUtils::AsyncPanZoomEnabled only changes if we descend into a frame whose display root widget is different. But that is not possible, we do not descend into any frames that are in different widgets.

Differential Revision: https://phabricator.services.mozilla.com/D197237
This commit is contained in:
Timothy Nikkel 2023-12-30 10:23:09 +00:00
Родитель 6856d0cab9
Коммит 3c39e0db98
2 изменённых файлов: 3 добавлений и 2 удалений

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

@ -790,8 +790,8 @@ bool DisplayPortUtils::MaybeCreateDisplayPort(
// async-scrollable frame (i.e. one that WantsAsyncScroll()) has a
// displayport. If that's not the case yet, and we are async-scrollable, we
// will get a displayport.
MOZ_ASSERT(nsLayoutUtils::AsyncPanZoomEnabled(aScrollFrame));
if (!aBuilder->HaveScrollableDisplayPort() &&
nsLayoutUtils::AsyncPanZoomEnabled(aScrollFrame) &&
aScrollFrameAsScrollable->WantAsyncScroll()) {
bool haveDisplayPort = HasNonMinimalNonZeroDisplayPort(content);
// If we don't already have a displayport, calculate and set one.

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

@ -3168,7 +3168,8 @@ void nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext, nsIFrame* aFrame,
}
builder->ClearHaveScrollableDisplayPort();
if (builder->IsPaintingToWindow()) {
if (builder->IsPaintingToWindow() &&
nsLayoutUtils::AsyncPanZoomEnabled(aFrame)) {
DisplayPortUtils::MaybeCreateDisplayPortInFirstScrollFrameEncountered(
aFrame, builder);
}