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

Unified Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 1672973002: ScrollableArea::pixelsPerLine should return viewport pixels in use-zoom-for-dsf mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/platform/scroll/ScrollableArea.cpp
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
index f6bfdf8bc7039a1319bcc0b1363304f78ae07932..f91bc0ff01e9bbcd0b41e2c11f60264744ee9243 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp
@@ -60,9 +60,11 @@ struct SameSizeAsScrollableArea {
static_assert(sizeof(ScrollableArea) == sizeof(SameSizeAsScrollableArea), "ScrollableArea should stay small");
-int ScrollableArea::pixelsPerLineStep()
+int ScrollableArea::pixelsPerLineStep(HostWindow* host)
{
- return kPixelsPerLineStep;
+ if (!host)
+ return kPixelsPerLineStep;
+ return host->windowToViewportScalar(kPixelsPerLineStep);
}
float ScrollableArea::minFractionToStepWhenPaging()
@@ -566,7 +568,7 @@ DoublePoint ScrollableArea::clampScrollPosition(const DoublePoint& scrollPositio
int ScrollableArea::lineStep(ScrollbarOrientation) const
{
- return pixelsPerLineStep();
+ return pixelsPerLineStep(hostWindow());
}
int ScrollableArea::pageStep(ScrollbarOrientation orientation) const
@@ -586,6 +588,8 @@ int ScrollableArea::documentStep(ScrollbarOrientation orientation) const
float ScrollableArea::pixelStep(ScrollbarOrientation) const
{
+ if (HostWindow* window = hostWindow())
+ return window->windowToViewportScalar(1);
return 1;
}

Powered by Google App Engine
This is Rietveld 408576698