Index: Source/core/page/FrameView.cpp |
diff --git a/Source/core/page/FrameView.cpp b/Source/core/page/FrameView.cpp |
index 6361e0b757baafd17193c2be49401f50519cb66e..fcdb9d91f9faae35c587794634688b53bf04f795 100644 |
--- a/Source/core/page/FrameView.cpp |
+++ b/Source/core/page/FrameView.cpp |
@@ -179,6 +179,8 @@ FrameView::FrameView(Frame* frame) |
, m_didRunAutosize(false) |
, m_hasSoftwareFilters(false) |
, m_visibleContentScaleFactor(1) |
+ , m_canStopPartialLayout(false) |
+ , m_stopLayoutAtRenderer(0) |
{ |
init(); |
@@ -844,6 +846,12 @@ void FrameView::layout(bool allowSubtree) |
if (m_inLayout) |
return; |
+ if (m_canStopPartialLayout) { |
+ resetPartialLayoutState(); |
+ return; |
+ } |
+ //ASSERT(!m_canStopPartialLayout); |
+ |
TRACE_EVENT0("webkit", "FrameView::layout"); |
TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "Layout"); |
@@ -1010,6 +1018,12 @@ void FrameView::layout(bool allowSubtree) |
m_layoutRoot = 0; |
} // Reset m_layoutSchedulingEnabled to its previous value. |
+ if (m_canStopPartialLayout) { |
+ // Reset partial layout state post-layout. |
+ resetPartialLayoutState(); |
+ return; |
+ } |
+ |
bool neededFullRepaint = m_doFullRepaint; |
if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->printing()) |
@@ -1035,9 +1049,22 @@ void FrameView::layout(bool allowSubtree) |
cache->postNotification(rootForThisLayout, AXObjectCache::AXLayoutComplete, true); |
updateAnnotatedRegions(); |
+ if (m_canStopPartialLayout) { |
+ // Reset partial layout state post-layout. |
+ resetPartialLayoutState(); |
+ return; |
+ } |
+ |
layoutLazyBlocks(); |
- ASSERT(!rootForThisLayout->needsLayout()); |
+ if (m_canStopPartialLayout) { |
+ // Reset partial layout state post-layout. |
+ resetPartialLayoutState(); |
+ return; |
+ } |
+ |
+ if (!m_canStopPartialLayout) |
+ ASSERT(!rootForThisLayout->needsLayout()); |
updateCanBlitOnScrollRecursively(); |
@@ -1079,11 +1106,16 @@ void FrameView::layout(bool allowSubtree) |
return; |
#ifndef NDEBUG |
- // Post-layout assert that nobody was re-marked as needing layout during layout. |
- for (RenderObject* renderer = document->renderer(); renderer; renderer = renderer->nextInPreOrder()) |
- ASSERT(!renderer->needsLayout()); |
+ if (!m_canStopPartialLayout) { |
+ // Post-layout assert that nobody was re-marked as needing layout during layout. |
+ for (RenderObject* renderer = document->renderer(); renderer; renderer = renderer->nextInPreOrder()) |
+ ASSERT(!renderer->needsLayout()); |
+ } |
#endif |
+ // Reset partial layout state post-layout. |
+ resetPartialLayoutState(); |
+ |
// FIXME: It should be not possible to remove the FrameView from the frame/page during layout |
// however m_inLayout is not set for most of this function, so none of our RELEASE_ASSERTS |
// in Frame/Page will fire. One of the post-layout tasks is disconnecting the Frame from |
@@ -1124,6 +1156,15 @@ void FrameView::layoutLazyBlocks() |
} |
} |
+void FrameView::checkPartialLayoutComplete(RenderObject* renderer) |
+{ |
+ if (renderer == m_stopLayoutAtRenderer) { |
+ //fprintf(stderr, "stopping partial layout!\n"); |
+ //BACKTRACE(); |
+ m_canStopPartialLayout = true; |
+ } |
+} |
+ |
RenderBox* FrameView::embeddedContentBox() const |
{ |
RenderView* renderView = this->renderView(); |