Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1051)

Unified Diff: Source/core/frame/FrameView.cpp

Issue 1223173006: Get rid of clampScrollOffset and make maximumScrollPosition sane. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revert changes to Element::clientWidth, etc. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/layout/LayoutTextControlSingleLine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/FrameView.cpp
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp
index 447ac80c546a25b52b9c4bedd5fe94ec7a119198..efcdd6c3a22a18d209f366da8f030030480bf837 100644
--- a/Source/core/frame/FrameView.cpp
+++ b/Source/core/frame/FrameView.cpp
@@ -2990,17 +2990,10 @@ 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 = visibleContentSize(ExcludeScrollbars);
- visibleSize.expand(0, m_topControlsViewportAdjustment);
-
- FloatSize contentBounds = contentsSize();
- contentBounds = flooredIntSize(contentBounds);
-
- FloatSize maximumOffset = contentBounds - visibleSize - toIntSize(scrollOrigin());
-
- IntPoint snappedMaximumOffset = flooredIntPoint(maximumOffset);
- snappedMaximumOffset = snappedMaximumOffset.expandedTo(minimumScrollPosition());
- return snappedMaximumOffset;
+ IntSize visibleSize = visibleContentSize(ExcludeScrollbars) + topControlsSize();
+ IntSize contentBounds = contentsSize();
+ IntPoint maximumPosition = -scrollOrigin() + (contentBounds - visibleSize);
+ return maximumPosition.expandedTo(minimumScrollPosition());
}
void FrameView::addChild(PassRefPtrWillBeRawPtr<Widget> prpChild)
« no previous file with comments | « Source/core/frame/FrameView.h ('k') | Source/core/layout/LayoutTextControlSingleLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698