| 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 1b09755291e499ef50f498b6aef95f6a619154db..9b21abf08e571a8ecb9addbbeb5dc7af8c205920 100644
|
| --- a/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
|
| @@ -167,6 +167,7 @@ FrameView::FrameView(LocalFrame* frame)
|
| , m_crossOriginForThrottling(false)
|
| , m_subtreeThrottled(false)
|
| , m_currentUpdateLifecyclePhasesTargetState(DocumentLifecycle::Uninitialized)
|
| + , m_needsScrollbarsUpdate(false)
|
| , m_suppressAdjustViewSize(false)
|
| , m_allowsLayoutInvalidationAfterLayoutClean(true)
|
| {
|
| @@ -392,29 +393,34 @@ void FrameView::setFrameRect(const IntRect& newRect)
|
| return;
|
|
|
| Widget::setFrameRect(newRect);
|
| - frameRectsChanged();
|
|
|
| - if (oldRect.size() == newRect.size())
|
| - return;
|
| + const bool frameSizeChanged = oldRect.size() != newRect.size();
|
|
|
| + m_needsScrollbarsUpdate = frameSizeChanged;
|
| // TODO(wjmaclean): find out why scrollbars fail to resize for complex
|
| // subframes after changing the zoom level. For now always calling
|
| // updateScrollbarsIfNeeded() here fixes the issue, but it would be good to
|
| // discover the deeper cause of this. http://crbug.com/607987.
|
| - updateScrollbars();
|
| + updateScrollbarsIfNeeded();
|
| +
|
| + frameRectsChanged();
|
|
|
| updateScrollableAreaSet();
|
|
|
| if (LayoutViewItem layoutView = this->layoutViewItem()) {
|
| + // TODO(majidvp): It seems that this only needs to be called when size
|
| + // is updated ignoring any change in the location.
|
| if (layoutView.usesCompositing())
|
| layoutView.compositor()->frameViewDidChangeSize();
|
| }
|
|
|
| - viewportSizeChanged(newRect.width() != oldRect.width(), newRect.height() != oldRect.height());
|
| + if (frameSizeChanged) {
|
| + viewportSizeChanged(newRect.width() != oldRect.width(), newRect.height() != oldRect.height());
|
|
|
| - if (m_frame->isMainFrame())
|
| - m_frame->host()->visualViewport().mainFrameDidChangeSize();
|
| - frame().loader().restoreScrollPositionAndViewState();
|
| + if (m_frame->isMainFrame())
|
| + m_frame->host()->visualViewport().mainFrameDidChangeSize();
|
| + frame().loader().restoreScrollPositionAndViewState();
|
| + }
|
| }
|
|
|
| Page* FrameView::page() const
|
| @@ -3590,12 +3596,14 @@ bool FrameView::shouldIgnoreOverflowHidden() const
|
|
|
| void FrameView::updateScrollbarsIfNeeded()
|
| {
|
| - if (needsScrollbarReconstruction() || scrollOriginChanged())
|
| + if (m_needsScrollbarsUpdate || needsScrollbarReconstruction() || scrollOriginChanged())
|
| updateScrollbars();
|
| }
|
|
|
| void FrameView::updateScrollbars()
|
| {
|
| + m_needsScrollbarsUpdate = false;
|
| +
|
| if (m_frame->settings() && m_frame->settings()->rootLayerScrolls())
|
| return;
|
|
|
|
|