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

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

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: Fix clamping, comment tweaks Created 4 years, 2 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
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index b8e75b5c761b2e5191e1d250be89fb0e9beb1aaa..cee687540b1a136ad3b63cb5e2188fc351252f21 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -3562,14 +3562,10 @@ int FrameView::scrollSize(ScrollbarOrientation orientation) const {
return scrollbar->totalSize() - scrollbar->visibleSize();
}
-void FrameView::setScrollOffset(const DoublePoint& offset,
+void FrameView::setScrollOffset(const DoublePoint& position,
bokan 2016/10/04 22:17:25 This param renaming was probably meant for the sec
szager1 2016/10/04 22:54:13 Indeed, fixed.
ScrollType scrollType) {
- // TODO(skobes): We shouldn't have to clamp here; instead we should update callers
- // ScrollableArea::scrollPositionChanged to only pass clamped offsets.
- DoublePoint newPosition = clampScrollPosition(offset);
-
DoublePoint oldPosition = m_scrollPosition;
- DoubleSize scrollDelta = newPosition - oldPosition;
+ DoubleSize scrollDelta = position - oldPosition;
if (scrollDelta.isZero())
return;
@@ -3578,7 +3574,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset,
ASSERT_NOT_REACHED();
}
- m_scrollPosition = newPosition;
+ m_scrollPosition = position;
if (!scrollbarsSuppressed())
m_pendingScrollDelta += scrollDelta;

Powered by Google App Engine
This is Rietveld 408576698