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

Unified Diff: chrome/renderer/render_view.cc

Issue 3999002: When zooming, webkit reports width and height as if the zoom wasn't there (by... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix windows build Created 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 63072)
+++ chrome/renderer/render_view.cc (working copy)
@@ -3496,6 +3496,12 @@
// they're different.
gfx::Size size(webview()->mainFrame()->contentsPreferredWidth(),
webview()->mainFrame()->documentElementScrollHeight());
+ // In the presence of zoom, these sizes are still reported as if unzoomed,
+ // so we need to adjust.
+ double zoom_factor = WebView::zoomLevelToZoomFactor(webview()->zoomLevel());
+ size.set_width(static_cast<int>(size.width() * zoom_factor));
+ size.set_height(static_cast<int>(size.height() * zoom_factor));
+
if (size == preferred_size_)
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698