Bug 1034240 - Trigger an update of the displayport margins on a new APZC if the content already has margins. r=botond

This commit is contained in:
Kartikaya Gupta 2014-07-21 14:00:52 -04:00
Родитель 0cd41b2669
Коммит a1cc48a946
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -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