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 |