Chromium Code Reviews| Index: Source/core/layout/LayoutFlowThread.cpp |
| diff --git a/Source/core/layout/LayoutFlowThread.cpp b/Source/core/layout/LayoutFlowThread.cpp |
| index 34e5d7793c5f95f03bd9b7239199d10e45d43fa7..d2c0a72e0a2f5d15457fe731281bc513b498d25f 100644 |
| --- a/Source/core/layout/LayoutFlowThread.cpp |
| +++ b/Source/core/layout/LayoutFlowThread.cpp |
| @@ -43,6 +43,30 @@ LayoutFlowThread::LayoutFlowThread() |
| { |
| } |
| +LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf(const LayoutObject& descendant) |
| +{ |
| + ASSERT(descendant.isInsideFlowThread()); |
| + LayoutObject* curr = const_cast<LayoutObject*>(&descendant); |
|
leviw_travelin_and_unemployed
2015/08/11 17:51:07
What fails in this function if you remove this con
mstensho (USE GERRIT)
2015/08/11 19:09:18
toLayoutFlowThread(), because the constness of inp
|
| + while (curr) { |
| + if (curr->isSVG() && !curr->isSVGRoot()) |
| + return nullptr; |
| + if (curr->isLayoutFlowThread()) |
| + return toLayoutFlowThread(curr); |
| + LayoutObject* container = curr->container(); |
| + curr = curr->parent(); |
| + while (curr != container) { |
| + 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 nullptr; |
| +} |
| + |
| void LayoutFlowThread::removeColumnSetFromThread(LayoutMultiColumnSet* columnSet) |
| { |
| ASSERT(columnSet); |