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

Side by Side Diff: Source/core/rendering/SubtreeLayoutScope.cpp

Issue 18601002: Add infrastructure for partial layouts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: If text autosizing is enabled, only partial layout for the second of two layouts 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 namespace WebCore { 37 namespace WebCore {
38 38
39 SubtreeLayoutScope::SubtreeLayoutScope(RenderObject* root) 39 SubtreeLayoutScope::SubtreeLayoutScope(RenderObject* root)
40 : m_root(root) 40 : m_root(root)
41 { 41 {
42 RELEASE_ASSERT(m_root->document()->view()->isInLayout()); 42 RELEASE_ASSERT(m_root->document()->view()->isInLayout());
43 } 43 }
44 44
45 SubtreeLayoutScope::~SubtreeLayoutScope() 45 SubtreeLayoutScope::~SubtreeLayoutScope()
46 { 46 {
47 RELEASE_ASSERT(!m_root->needsLayout()); 47 if (!m_root->document()->view()->shouldStopPartialLayout()) {
esprehn 2013/08/18 03:43:15 This should be an early return.
pdr. 2013/08/20 06:19:10 Done.
48 RELEASE_ASSERT(!m_root->needsLayout());
48 49
49 #ifndef NDEBUG 50 #ifndef NDEBUG
50 for (HashSet<RenderObject*>::iterator it = m_renderersToLayout.begin(); it ! = m_renderersToLayout.end(); ++it) { 51 for (HashSet<RenderObject*>::iterator it = m_renderersToLayout.begin(); it != m_renderersToLayout.end(); ++it) {
51 RenderObject* renderer = *it; 52 RenderObject* renderer = *it;
52 // FIXME: Thie patter is really common. Move it into an assertRendererLa idOut function. 53 // FIXME: Thie patter is really common. Move it into an assertRender erLaidOut function.
53 if (renderer->needsLayout()) 54 if (renderer->needsLayout())
54 showRenderTree(renderer); 55 showRenderTree(renderer);
55 ASSERT(!renderer->needsLayout()); 56 ASSERT(!renderer->needsLayout());
57 }
58 #endif
56 } 59 }
57 #endif
58 } 60 }
59 61
60 void SubtreeLayoutScope::setNeedsLayout(RenderObject* descendant) 62 void SubtreeLayoutScope::setNeedsLayout(RenderObject* descendant)
61 { 63 {
62 ASSERT(descendant->isDescendantOf(m_root)); 64 ASSERT(descendant->isDescendantOf(m_root));
63 descendant->setNeedsLayout(MarkContainingBlockChain, this); 65 descendant->setNeedsLayout(MarkContainingBlockChain, this);
64 } 66 }
65 67
66 void SubtreeLayoutScope::setChildNeedsLayout(RenderObject* descendant) 68 void SubtreeLayoutScope::setChildNeedsLayout(RenderObject* descendant)
67 { 69 {
68 ASSERT(descendant->isDescendantOf(m_root)); 70 ASSERT(descendant->isDescendantOf(m_root));
69 descendant->setChildNeedsLayout(MarkContainingBlockChain, this); 71 descendant->setChildNeedsLayout(MarkContainingBlockChain, this);
70 } 72 }
71 73
72 void SubtreeLayoutScope::addRendererToLayout(RenderObject* renderer) 74 void SubtreeLayoutScope::addRendererToLayout(RenderObject* renderer)
73 { 75 {
74 #ifndef NDEBUG 76 #ifndef NDEBUG
75 m_renderersToLayout.add(renderer); 77 m_renderersToLayout.add(renderer);
76 #endif 78 #endif
77 } 79 }
78 80
79 } 81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698