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

Unified Diff: Source/core/layout/LayoutObject.cpp

Issue 1109513002: [New Multicolumn] Don't enter child multicol contexts when processing object insertions / removals. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review: renderer -> layoutObject Created 5 years, 8 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/layout/LayoutMultiColumnFlowThread.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index bc86abc31361267b0e5d912628e222654483743d..152ad2c32c20fef589cc4f2d9229df8f4102d2fd 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -267,10 +267,14 @@ bool LayoutObject::isLegend() const
void LayoutObject::setFlowThreadStateIncludingDescendants(FlowThreadState state)
{
- for (LayoutObject *object = this; object; object = object->nextInPreOrder(this)) {
+ LayoutObject* next;
+ for (LayoutObject *object = this; object; object = next) {
// If object is a fragmentation context it already updated the descendants flag accordingly.
- if (object->isLayoutFlowThread())
+ if (object->isLayoutFlowThread()) {
+ next = object->nextInPreOrderAfterChildren(this);
continue;
+ }
+ next = object->nextInPreOrder(this);
ASSERT(state != object->flowThreadState());
object->setFlowThreadState(state);
}
@@ -2495,8 +2499,11 @@ void LayoutObject::removeFromLayoutFlowThread()
void LayoutObject::removeFromLayoutFlowThreadRecursive(LayoutFlowThread* renderFlowThread)
{
if (const LayoutObjectChildList* children = virtualChildren()) {
- for (LayoutObject* child = children->firstChild(); child; child = child->nextSibling())
- child->removeFromLayoutFlowThreadRecursive(renderFlowThread);
+ for (LayoutObject* child = children->firstChild(); child; child = child->nextSibling()) {
+ if (child->isLayoutFlowThread())
+ continue; // Don't descend into inner fragmentation contexts.
+ child->removeFromLayoutFlowThreadRecursive(child->isLayoutFlowThread() ? toLayoutFlowThread(child) : renderFlowThread);
+ }
}
if (renderFlowThread && renderFlowThread != this)
« no previous file with comments | « Source/core/layout/LayoutMultiColumnFlowThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698