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

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

Issue 1286693003: Move code for locating the containing flow thread out of LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/LayoutFlowThread.h ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « Source/core/layout/LayoutFlowThread.h ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698