Index: Source/core/frame/FrameView.cpp |
diff --git a/Source/core/frame/FrameView.cpp b/Source/core/frame/FrameView.cpp |
index 7746f348bf0c895e4966c9ba283bd36ddec8831a..faf08b9a60436adc55a6d7dc6f9f3cb4b0a39812 100644 |
--- a/Source/core/frame/FrameView.cpp |
+++ b/Source/core/frame/FrameView.cpp |
@@ -3179,8 +3179,40 @@ void FrameView::setLayoutSizeInternal(const IntSize& size) |
if (m_layoutSize == size) |
return; |
+ bool widthChanged = m_layoutSize.width() != size.width(); |
m_layoutSize = size; |
- contentsResized(); |
+ |
+ // Update scrollbars. Not calling this->contentsResized() to avoid setNeedsLayout. |
+ ScrollView::contentsResized(); |
Julien - ping for review
2014/03/11 01:23:37
Wouldn't it be possible to remove FrameView::conte
Xianzhu
2014/03/11 19:05:13
Agreed. Need to carefully check all callsites of i
|
+ |
+ if (widthChanged) { |
+ setNeedsLayout(); |
+ return; |
+ } |
+ |
+ if (RenderView* renderView = this->renderView()) { |
Julien - ping for review
2014/03/11 01:23:37
This would be better with an early return, especia
Xianzhu
2014/03/11 19:05:13
Done.
|
+ // If needsLayout, the next layout will do all the things required on layoutSize change. |
+ if (renderView->needsLayout()) |
+ return; |
+ |
+ performPreLayoutTasks(); |
+ |
+ // During pre-layout tasks, viewport media queries, viewport sizes and others may cause |
+ // style update and set needsLayout flag. |
+ if (renderView->needsLayout()) |
+ return; |
+ |
+ if (!renderView->trySimplifiedLayoutOnHeightChange()) { |
+ setNeedsLayout(); |
+ return; |
+ } |
+ |
+ // RenderView has finished a simplified layout for the height change. We need to perform |
+ // necessary post-layout tasks for the simplified layout. |
+ scheduleOrPerformPostLayoutTasks(); |
+ if (frame().page()) |
+ frame().page()->chrome().client().layoutUpdated(m_frame.get()); |
+ } |
} |
void FrameView::didAddScrollbar(Scrollbar* scrollbar, ScrollbarOrientation orientation) |