| Index: Source/core/frame/FrameView.cpp
|
| diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
|
| index e87ee438000f7cdccbbd7d5d1b373c83cd69aa19..7d51be2ee2da3dbd8da3d1a36a7ab5b8b0a90dde 100644
|
| --- a/Source/core/frame/FrameView.cpp
|
| +++ b/Source/core/frame/FrameView.cpp
|
| @@ -3082,16 +3082,23 @@ void FrameView::setTopControlsViewportAdjustment(float adjustment)
|
|
|
| IntPoint FrameView::maximumScrollPosition() const
|
| {
|
| - FloatSize visibleContentSizeF = unscaledVisibleContentSize(ExcludeScrollbars);
|
| - visibleContentSizeF.expand(0, -m_topControlsViewportAdjustment);
|
| - visibleContentSizeF.scale(1 / visibleContentScaleFactor());
|
| - IntSize visibleSize = expandedIntSize(visibleContentSizeF);
|
| -
|
| - IntPoint maximumOffset(
|
| - contentsWidth() - visibleSize.width() - scrollOrigin().x(),
|
| - contentsHeight() - visibleSize.height() - scrollOrigin().y());
|
| - maximumOffset.clampNegativeToZero();
|
| - return maximumOffset;
|
| + // Make the same calculation as in CC's LayerImpl::MaxScrollOffset()
|
| + // FIXME: We probably shouldn't be storing the bounds in a float. crbug.com/422331.
|
| + FloatSize visibleSize = unscaledVisibleContentSize(ExcludeScrollbars);
|
| + visibleSize.expand(0, m_topControlsViewportAdjustment);
|
| +
|
| + FloatSize contentBounds = contentsSize();
|
| + contentBounds.scale(visibleContentScaleFactor());
|
| + contentBounds = flooredIntSize(contentBounds);
|
| +
|
| + FloatSize maximumOffset = contentBounds - visibleSize - toIntSize(scrollOrigin());
|
| +
|
| + // Convert back to CSS pixels.
|
| + maximumOffset.scale(1 / visibleContentScaleFactor());
|
| +
|
| + IntPoint snappedMaximumOffset = flooredIntPoint(maximumOffset);
|
| + snappedMaximumOffset.clampNegativeToZero();
|
| + return snappedMaximumOffset;
|
| }
|
|
|
| void FrameView::addChild(PassRefPtrWillBeRawPtr<Widget> prpChild)
|
|
|