diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index 99c59ec4dfcb..4ac2d0af0882 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -2344,6 +2344,15 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri mFrameMetrics = aLayerMetrics; mLastDispatchedPaintMetrics = aLayerMetrics; ShareCompositorFrameMetrics(); + + if (mFrameMetrics.GetDisplayPortMargins() != LayerMargin()) { + // A non-zero display port margin here indicates a displayport has + // been set by a previous APZC for the content at this guid. The + // scrollable rect may have changed since then, making the margins + // wrong, so we need to calculate a new display port. + APZC_LOG("%p detected non-empty margins which probably need updating\n", this); + needContentRepaint = true; + } } else { // If we're not taking the aLayerMetrics wholesale we still need to pull // in some things into our local mFrameMetrics because these things are