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

Unified Diff: third_party/WebKit/Source/core/page/SpatialNavigation.cpp

Issue 2290233007: Move convertViewportToWindow and convertWindowToViewport from (Closed)
Patch Set: add client to WebSharedWorkerImpl Created 4 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
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 ac287f78df832b9dd1af804a633af619106d17ef..7cb8c71e158ad348b340314c4f59d46e9ea094b3 100644
--- a/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
+++ b/third_party/WebKit/Source/core/page/SpatialNavigation.cpp
@@ -160,7 +160,7 @@ bool hasOffscreenRect(Node* node, WebFocusType type)
// exposed after we scroll. Adjust the viewport to post-scrolling position.
// If the container has overflow:hidden, we cannot scroll, so we do not pass direction
// and we do not adjust for scrolling.
- int pixelsPerLineStep = ScrollableArea::pixelsPerLineStep(frameView->getHostWindow());
+ int pixelsPerLineStep = ScrollableArea::pixelsPerLineStep(frameView->getHostWindow(), frameView);
switch (type) {
case WebFocusTypeLeft:
containerViewportRect.setX(containerViewportRect.x() - pixelsPerLineStep);
@@ -198,7 +198,7 @@ bool scrollInDirection(LocalFrame* frame, WebFocusType type)
if (frame && canScrollInDirection(frame->document(), type)) {
int dx = 0;
int dy = 0;
- int pixelsPerLineStep = ScrollableArea::pixelsPerLineStep(frame->view()->getHostWindow());
+ int pixelsPerLineStep = ScrollableArea::pixelsPerLineStep(frame->view()->getHostWindow(), frame->view());
switch (type) {
case WebFocusTypeLeft:
dx = - pixelsPerLineStep;
@@ -237,7 +237,7 @@ bool scrollInDirection(Node* container, WebFocusType type)
int dy = 0;
// TODO(leviw): Why are these values truncated (toInt) instead of rounding?
FrameView* frameView = container->document().view();
- int pixelsPerLineStep = ScrollableArea::pixelsPerLineStep(frameView ? frameView->getHostWindow() : nullptr);
+ int pixelsPerLineStep = ScrollableArea::pixelsPerLineStep(frameView ? frameView->getHostWindow() : nullptr, frameView);
switch (type) {
case WebFocusTypeLeft:
dx = - std::min(pixelsPerLineStep, container->layoutBox()->scrollLeft().toInt());
« no previous file with comments | « third_party/WebKit/Source/core/loader/EmptyClients.h ('k') | third_party/WebKit/Source/platform/HostWindow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698