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

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

Issue 1108633002: [New Multicolumn] Only the nearest ancestral flow thread may serve as a containing flow thread. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review. 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
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index 42e24d180e37902637798d3b3d1ddc2e09387728..9a128f6d43921fcfd7c8eab6e88579ff29c25033 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -611,9 +611,19 @@ LayoutFlowThread* LayoutObject::locateFlowThreadContainingBlock() const
while (curr) {
if (curr->isLayoutFlowThread())
return toLayoutFlowThread(curr);
- curr = curr->containingBlock();
+ LayoutObject* containingBlock = curr->containingBlock();
+ curr = curr->parent();
+ while (curr != containingBlock) {
+ if (curr->isLayoutFlowThread()) {
+ // The nearest ancestor flow thread isn't in our containing block chain. Then we
+ // aren't really part of any flow thread, and we should stop looking. This happens
+ // when there are out-of-flow objects or column spanners.
+ return nullptr;
+ }
+ curr = curr->parent();
+ }
}
- return 0;
+ return nullptr;
}
// FIXME: This could be used when changing the size of a renderer without children to skip some invalidations.
@@ -2462,7 +2472,7 @@ void LayoutObject::insertedIntoTree()
if (!isFloating() && parent()->childrenInline())
parent()->dirtyLinesFromChangedChild(this);
- if (LayoutFlowThread* flowThread = parent()->flowThreadContainingBlock())
+ if (LayoutFlowThread* flowThread = flowThreadContainingBlock())
flowThread->flowThreadDescendantWasInserted(this);
}
« no previous file with comments | « LayoutTests/fast/multicol/span/in-nested-multicol-with-list-item-expected.txt ('k') | Source/core/layout/LayoutState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698