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

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

Issue 1957103002: Exclude scrollbars from visual viewport dimensions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 7 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/VisualViewport.cpp
diff --git a/third_party/WebKit/Source/core/frame/VisualViewport.cpp b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
index 65b80677087df051fdbea24cfdaa560cdbee2220..6e0ae3869f6bf868987a1961fe715a323424c1a1 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewport.cpp
+++ b/third_party/WebKit/Source/core/frame/VisualViewport.cpp
@@ -258,7 +258,8 @@ double VisualViewport::clientWidth()
updateLayoutIgnorePendingStylesheets();
- return adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame()->pageZoomFactor());
+ double width = adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame()->pageZoomFactor());
+ return width - mainFrame()->view()->verticalScrollbarWidth();
}
double VisualViewport::clientHeight()
@@ -268,7 +269,8 @@ double VisualViewport::clientHeight()
updateLayoutIgnorePendingStylesheets();
- return adjustScrollForAbsoluteZoom(visibleSize().height(), mainFrame()->pageZoomFactor());
+ double height = adjustScrollForAbsoluteZoom(visibleSize().height(), mainFrame()->pageZoomFactor());
+ return height - mainFrame()->view()->horizontalScrollbarHeight();
}
double VisualViewport::pageScale()

Powered by Google App Engine
This is Rietveld 408576698