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

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

Issue 2383113003: Refactor ScrollableArea::setScrollPosition. (Closed)
Patch Set: nits and rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..762de3e5a43566b10b23f8f18324d7da79d14cb8 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -3564,12 +3564,8 @@ int FrameView::scrollSize(ScrollbarOrientation orientation) const {
void FrameView::setScrollOffset(const DoublePoint& offset,
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 = offset - oldPosition;
if (scrollDelta.isZero())
return;
@@ -3578,7 +3574,7 @@ void FrameView::setScrollOffset(const DoublePoint& offset,
ASSERT_NOT_REACHED();
}
- m_scrollPosition = newPosition;
+ m_scrollPosition = offset;
if (!scrollbarsSuppressed())
m_pendingScrollDelta += scrollDelta;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698