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

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

Issue 2716453004: vh units shouldn't add controls height when controls are locked to hidden. (Closed)
Patch Set: Remove extra whitespace Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/BrowserControlsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index 333d17dea30e5a45a176685a846d9fb2bab5e21e..2472ac3dfe2b6aa531d13c285bcd71eaef6665f9 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1400,16 +1400,17 @@ IntRect FrameView::computeVisibleArea() {
FloatSize FrameView::viewportSizeForViewportUnits() const {
float zoom = frame().pageZoomFactor();
- FloatSize layoutSize;
-
LayoutViewItem layoutViewItem = this->layoutViewItem();
if (layoutViewItem.isNull())
- return layoutSize;
+ return FloatSize();
+ FloatSize layoutSize;
layoutSize.setWidth(layoutViewItem.viewWidth(IncludeScrollbars) / zoom);
layoutSize.setHeight(layoutViewItem.viewHeight(IncludeScrollbars) / zoom);
- if (RuntimeEnabledFeatures::inertTopControlsEnabled()) {
+ BrowserControls& browserControls = m_frame->host()->browserControls();
+ if (RuntimeEnabledFeatures::inertTopControlsEnabled() &&
+ browserControls.permittedState() != WebBrowserControlsHidden) {
// We use the layoutSize rather than frameRect to calculate viewport units
// so that we get correct results on mobile where the page is laid out into
// a rect that may be larger than the viewport (e.g. the 980px fallback
@@ -1417,7 +1418,6 @@ FloatSize FrameView::viewportSizeForViewportUnits() const {
// be the viewport with browser controls showing, we add the browser
// controls height, compensating for page scale as well, since we want to
// use the viewport with browser controls hidden for vh (to match Safari).
- BrowserControls& browserControls = m_frame->host()->browserControls();
int viewportWidth = m_frame->host()->visualViewport().size().width();
if (m_frame->isMainFrame() && layoutSize.width() && viewportWidth) {
float pageScaleAtLayoutWidth = viewportWidth / layoutSize.width();
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/BrowserControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698