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

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: Fix release compile, minor cleanups 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
Index: Source/core/page/FrameView.cpp
diff --git a/Source/core/page/FrameView.cpp b/Source/core/page/FrameView.cpp
index 8f0cb6b8f1cce3967d9ab878be73eeac73f4bdd7..45eebc74ba1cfa22ba083be51fd9c364a1670183 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_shouldStopPartialLayout(false)
+ , m_stopLayoutAtRenderer(0)
{
init();
@@ -844,6 +846,14 @@ void FrameView::layout(bool allowSubtree)
if (m_inLayout)
return;
+ ASSERT(!shouldStopPartialLayout());
+ /*
+ if (shouldStopPartialLayout()) {
+ resetPartialLayoutState();
+ return;
+ }
+ */
+
TRACE_EVENT0("webkit", "FrameView::layout");
TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "Layout");
@@ -1010,6 +1020,12 @@ void FrameView::layout(bool allowSubtree)
m_layoutRoot = 0;
} // Reset m_layoutSchedulingEnabled to its previous value.
+ if (shouldStopPartialLayout()) {
+ // Reset partial layout state post-layout.
+ resetPartialLayoutState();
+ return;
+ }
+
bool neededFullRepaint = m_doFullRepaint;
if (!inSubtreeLayout && !toRenderView(rootForThisLayout)->printing())
@@ -1035,9 +1051,22 @@ void FrameView::layout(bool allowSubtree)
cache->postNotification(rootForThisLayout, AXObjectCache::AXLayoutComplete, true);
updateAnnotatedRegions();
+ if (shouldStopPartialLayout()) {
+ // Reset partial layout state post-layout.
+ resetPartialLayoutState();
+ return;
+ }
+
layoutLazyBlocks();
- ASSERT(!rootForThisLayout->needsLayout());
+ if (shouldStopPartialLayout()) {
+ // Reset partial layout state post-layout.
+ resetPartialLayoutState();
+ return;
+ }
+
+ if (!shouldStopPartialLayout())
+ ASSERT(!rootForThisLayout->needsLayout());
updateCanBlitOnScrollRecursively();
@@ -1079,11 +1108,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 (!shouldStopPartialLayout()) {
+ // 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 +1158,19 @@ void FrameView::layoutLazyBlocks()
}
}
+void FrameView::checkPartialLayoutComplete(RenderObject* renderer)
+{
+ ASSERT(renderer);
+ if (renderer == m_stopLayoutAtRenderer) {
+ // Make sure a partial layout was allowed.
+ do {
+ ASSERT(renderer->supportsPartialLayout());
+ } while ((renderer = renderer->parent()));
+
+ m_shouldStopPartialLayout = true;
+ }
+}
+
RenderBox* FrameView::embeddedContentBox() const
{
RenderView* renderView = this->renderView();

Powered by Google App Engine
This is Rietveld 408576698