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

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

Issue 2229303002: Revert "Remove extraneous frameView->setNeedsLayout() in LayoutPart" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows too. :( Created 4 years, 4 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
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;
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | third_party/WebKit/Source/core/layout/LayoutPart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698