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

Side by Side 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 unified diff | Download patch
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 setLocation(FloatPoint(location().x(), y * mainFrame()->pageZoomFactor())); 251 setLocation(FloatPoint(location().x(), y * mainFrame()->pageZoomFactor()));
252 } 252 }
253 253
254 double VisualViewport::clientWidth() 254 double VisualViewport::clientWidth()
255 { 255 {
256 if (!mainFrame()) 256 if (!mainFrame())
257 return 0; 257 return 0;
258 258
259 updateLayoutIgnorePendingStylesheets(); 259 updateLayoutIgnorePendingStylesheets();
260 260
261 return adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame()->pageZ oomFactor()); 261 double width = adjustScrollForAbsoluteZoom(visibleSize().width(), mainFrame( )->pageZoomFactor());
262 return width - mainFrame()->view()->verticalScrollbarWidth();
262 } 263 }
263 264
264 double VisualViewport::clientHeight() 265 double VisualViewport::clientHeight()
265 { 266 {
266 if (!mainFrame()) 267 if (!mainFrame())
267 return 0; 268 return 0;
268 269
269 updateLayoutIgnorePendingStylesheets(); 270 updateLayoutIgnorePendingStylesheets();
270 271
271 return adjustScrollForAbsoluteZoom(visibleSize().height(), mainFrame()->page ZoomFactor()); 272 double height = adjustScrollForAbsoluteZoom(visibleSize().height(), mainFram e()->pageZoomFactor());
273 return height - mainFrame()->view()->horizontalScrollbarHeight();
272 } 274 }
273 275
274 double VisualViewport::pageScale() 276 double VisualViewport::pageScale()
275 { 277 {
276 updateLayoutIgnorePendingStylesheets(); 278 updateLayoutIgnorePendingStylesheets();
277 279
278 return m_scale; 280 return m_scale;
279 } 281 }
280 282
281 void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location ) 283 void VisualViewport::setScaleAndLocation(float scale, const FloatPoint& location )
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 } else if (graphicsLayer == m_rootTransformLayer) { 836 } else if (graphicsLayer == m_rootTransformLayer) {
835 name = "Root Transform Layer"; 837 name = "Root Transform Layer";
836 } else { 838 } else {
837 ASSERT_NOT_REACHED(); 839 ASSERT_NOT_REACHED();
838 } 840 }
839 841
840 return name; 842 return name;
841 } 843 }
842 844
843 } // namespace blink 845 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698