| 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();
|
|
|