Chromium Code Reviews| Index: Source/core/layout/LayoutObject.cpp |
| diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp |
| index 42e24d180e37902637798d3b3d1ddc2e09387728..367b89316809291aef18d04cde5f61b7b1a77236 100644 |
| --- a/Source/core/layout/LayoutObject.cpp |
| +++ b/Source/core/layout/LayoutObject.cpp |
| @@ -611,7 +611,17 @@ 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 0; |
|
dsinclair
2015/04/27 14:45:24
nit: nullptr
mstensho (USE GERRIT)
2015/04/27 16:08:26
Done.
Fixed the one a few lines below this one as
|
| + } |
| + curr = curr->parent(); |
| + } |
| } |
| return 0; |
| } |
| @@ -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); |
| } |