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

Unified Diff: Source/core/platform/ScrollView.cpp

Issue 14703004: Reland "Unifies ScrollView and RenderLayer to use non-shi..." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 7 years, 7 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/platform/ScrollAnimator.cpp ('k') | Source/core/platform/ScrollableArea.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/ScrollView.cpp
diff --git a/Source/core/platform/ScrollView.cpp b/Source/core/platform/ScrollView.cpp
index 575de45ed020e2edb8bc23521b5e1d90e11dcb67..5a06473b98710bbf126a9a9b19d0f741f6817795 100644
--- a/Source/core/platform/ScrollView.cpp
+++ b/Source/core/platform/ScrollView.cpp
@@ -306,18 +306,7 @@ void ScrollView::notifyPageThatContentAreaWillPaint() const
void ScrollView::setScrollOffset(const IntPoint& offset)
{
- int horizontalOffset = offset.x();
- int verticalOffset = offset.y();
- if (constrainsScrollingToContentEdge()) {
- horizontalOffset = max(min(horizontalOffset, contentsWidth() - visibleWidth()), 0);
- verticalOffset = max(min(verticalOffset, contentsHeight() - visibleHeight()), 0);
- }
-
- IntSize newOffset = m_scrollOffset;
- newOffset.setWidth(horizontalOffset - scrollOrigin().x());
- newOffset.setHeight(verticalOffset - scrollOrigin().y());
-
- scrollTo(newOffset);
+ scrollTo(toIntSize(adjustScrollPositionWithinRange(offset)));
}
void ScrollView::scrollTo(const IntSize& newOffset)
@@ -555,7 +544,7 @@ void ScrollView::updateScrollbars(const IntSize& desiredOffset)
adjustedScrollPosition = adjustScrollPositionWithinRange(adjustedScrollPosition);
if (adjustedScrollPosition != scrollPosition() || scrollOriginChanged()) {
- ScrollableArea::scrollToOffsetWithoutAnimation(adjustedScrollPosition + IntSize(scrollOrigin().x(), scrollOrigin().y()));
+ ScrollableArea::scrollToOffsetWithoutAnimation(adjustedScrollPosition);
resetScrollOriginChanged();
}
« no previous file with comments | « Source/core/platform/ScrollAnimator.cpp ('k') | Source/core/platform/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698