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

Unified Diff: Source/core/page/FrameView.cpp

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Work in progress v2 Created 7 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
« no previous file with comments | « Source/core/page/FrameView.h ('k') | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « Source/core/page/FrameView.h ('k') | Source/core/rendering/RenderBlock.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698