diff --git a/layout/base/DisplayPortUtils.cpp b/layout/base/DisplayPortUtils.cpp index 6846ff0c0834..0bee144b6170 100644 --- a/layout/base/DisplayPortUtils.cpp +++ b/layout/base/DisplayPortUtils.cpp @@ -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. diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 13b082ceb0a7..c85fbd4f7083 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -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); }