Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index afd4e3ba632a90f0a671dfaf15879158ca1e9724..d1ecd0e3d8646ec5e40a986d3267757a11098927 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -3030,23 +3030,16 @@ |
IntPoint FrameView::maximumScrollPosition() const |
{ |
- // 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; |
+ 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; |
} |
} // namespace blink |