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

Unified Diff: third_party/WebKit/Source/core/page/SpatialNavigation.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
Index: third_party/WebKit/Source/core/page/SpatialNavigation.cpp
diff --git a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
index d329451a9c3e691c055bd49ed5a02226e34c07df..fae5f8e406daf2473e5a23f09f86e10a36d09981 100644
--- a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
+++ b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
@@ -244,32 +244,22 @@ bool scrollInDirection(Node* container, WebFocusType type) {
frameView ? frameView->getHostWindow() : nullptr);
switch (type) {
case WebFocusTypeLeft:
- dx = -std::min(pixelsPerLineStep,
- container->layoutBox()->scrollLeft().toInt());
+ dx = -pixelsPerLineStep;
break;
case WebFocusTypeRight:
ASSERT(container->layoutBox()->scrollWidth() >
(container->layoutBox()->scrollLeft() +
container->layoutBox()->clientWidth()));
- dx = std::min(pixelsPerLineStep,
- (container->layoutBox()->scrollWidth() -
- (container->layoutBox()->scrollLeft() +
- container->layoutBox()->clientWidth()))
- .toInt());
+ dx = pixelsPerLineStep;
break;
case WebFocusTypeUp:
- dy = -std::min(pixelsPerLineStep,
- container->layoutBox()->scrollTop().toInt());
+ dy = -pixelsPerLineStep;
break;
case WebFocusTypeDown:
ASSERT(container->layoutBox()->scrollHeight() -
(container->layoutBox()->scrollTop() +
container->layoutBox()->clientHeight()));
- dy = std::min(pixelsPerLineStep,
- (container->layoutBox()->scrollHeight() -
- (container->layoutBox()->scrollTop() +
- container->layoutBox()->clientHeight()))
- .toInt());
+ dy = pixelsPerLineStep;
break;
default:
ASSERT_NOT_REACHED();
« no previous file with comments | « third_party/WebKit/Source/core/layout/ScrollEnums.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698