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

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

Issue 2720743002: vh units shouldn't add controls height when controls are locked to hidden. (Closed)
Patch Set: 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 c5cbaf7a0f567c57811c2ee7d819580a7120fd33..87d2ec4db28afd06803bbc28dd1b82e3dc901a17 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -1388,16 +1388,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
@@ -1405,7 +1406,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