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

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

Issue 2022013004: Relayout if FrameView::updateViewSize() set needsLayout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | no next file » | 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 f881a6042a874b94b9ee6295408a6c25b0d0dcb8..f5424abb836cbe0d89adb391899301cf66f2a0a4 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -161,6 +161,7 @@ FrameView::FrameView(LocalFrame* frame)
, m_isUpdatingAllLifecyclePhases(false)
, m_scrollAnchor(this)
, m_needsScrollbarsUpdate(false)
+ , m_suppressAdjustViewSize(false)
{
ASSERT(m_frame);
init();
@@ -531,6 +532,9 @@ void FrameView::setContentsSize(const IntSize& size)
void FrameView::adjustViewSize()
{
+ if (m_suppressAdjustViewSize)
+ return;
+
LayoutViewItem layoutViewItem = this->layoutViewItem();
if (layoutViewItem.isNull())
return;
@@ -553,6 +557,15 @@ void FrameView::adjustViewSize()
setContentsSize(size);
}
+void FrameView::adjustViewSizeAndLayout()
+{
+ adjustViewSize();
+ if (needsLayout()) {
+ TemporaryChange<bool> suppressAdjustViewSize(m_suppressAdjustViewSize, true);
+ layout();
+ }
+}
+
void FrameView::calculateScrollbarModesFromOverflowStyle(const ComputedStyle* style, ScrollbarMode& hMode, ScrollbarMode& vMode)
{
hMode = vMode = ScrollbarAuto;
@@ -1040,7 +1053,7 @@ void FrameView::layout()
} // Reset m_layoutSchedulingEnabled to its previous value.
if (!inSubtreeLayout && !document->printing())
szager1 2016/06/01 07:48:57 Can you make adjustViewSizeAndLayout return a bool
- adjustViewSize();
+ adjustViewSizeAndLayout();
m_frameTimingRequestsDirty = true;
@@ -2773,7 +2786,7 @@ void FrameView::forceLayoutForPagination(const FloatSize& pageSize, const FloatS
}
}
- adjustViewSize();
+ adjustViewSizeAndLayout();
}
IntRect FrameView::convertFromLayoutObject(const LayoutObject& layoutObject, const IntRect& layoutObjectRect) const
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698