Bug 1250213 - Ensure the scroll offset does not go outside the page bounds when going full screen r=kats

This commit is contained in:
Randall Barker 2016-03-07 12:15:37 -08:00
parent ec65f12dd8
commit 565a35d4d5

View File

@ -2684,7 +2684,10 @@ void AsyncPanZoomController::AdjustScrollForSurfaceShift(const ScreenPoint& aShi
/ mFrameMetrics.GetZoom();
APZC_LOG("%p adjusting scroll position by %s for surface shift\n",
this, Stringify(adjustment).c_str());
mFrameMetrics.ScrollBy(adjustment);
CSSPoint scrollOffset = mFrameMetrics.GetScrollOffset();
scrollOffset.y = mY.ClampOriginToScrollableRect(scrollOffset.y + adjustment.y);
scrollOffset.x = mX.ClampOriginToScrollableRect(scrollOffset.x + adjustment.x);
mFrameMetrics.SetScrollOffset(scrollOffset);
ScheduleCompositeAndMaybeRepaint();
UpdateSharedCompositorFrameMetrics();
}