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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 2226663003: window.visualViewport.clientWidth|Height shouldn't assume scaled scrollbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 } 234 }
235 235
236 double VisualViewport::clientWidth() 236 double VisualViewport::clientWidth()
237 { 237 {
238 if (!mainFrame()) 238 if (!mainFrame())
239 return 0; 239 return 0;
240 240
241 updateStyleAndLayoutIgnorePendingStylesheets(); 241 updateStyleAndLayoutIgnorePendingStylesheets();
242 242
243 double width = adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame( )->pageZoomFactor()); 243 double width = adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame( )->pageZoomFactor());
244 return width - mainFrame()->view()->verticalScrollbarWidth(); 244 return width - mainFrame()->view()->verticalScrollbarWidth() / m_scale;
245 } 245 }
246 246
247 double VisualViewport::clientHeight() 247 double VisualViewport::clientHeight()
248 { 248 {
249 if (!mainFrame()) 249 if (!mainFrame())
250 return 0; 250 return 0;
251 251
252 updateStyleAndLayoutIgnorePendingStylesheets(); 252 updateStyleAndLayoutIgnorePendingStylesheets();
253 253
254 double height = adjustScrollForAbsoluteZoom(visibleSize().height(), mainFram e()->pageZoomFactor()); 254 double height = adjustScrollForAbsoluteZoom(visibleSize().height(), mainFram e()->pageZoomFactor());
255 return height - mainFrame()->view()->horizontalScrollbarHeight(); 255 return height - mainFrame()->view()->horizontalScrollbarHeight() / m_scale;
256 } 256 }
257 257
258 double VisualViewport::pageScale() 258 double VisualViewport::pageScale()
259 { 259 {
260 updateStyleAndLayoutIgnorePendingStylesheets(); 260 updateStyleAndLayoutIgnorePendingStylesheets();
261 261
262 return m_scale; 262 return m_scale;
263 } 263 }
264 264
265 void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location ) 265 void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location )
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 } else if (graphicsLayer == m_rootTransformLayer.get()) { 832 } else if (graphicsLayer == m_rootTransformLayer.get()) {
833 name = "Root Transform Layer"; 833 name = "Root Transform Layer";
834 } else { 834 } else {
835 ASSERT_NOT_REACHED(); 835 ASSERT_NOT_REACHED();
836 } 836 }
837 837
838 return name; 838 return name;
839 } 839 }
840 840
841 } // namespace blink 841 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/viewport/viewport-dimensions-exclude-scrollbars.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698