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

Unified Diff: Source/core/layout/LayoutObject.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
Index: Source/core/layout/LayoutObject.cpp
diff --git a/Source/core/layout/LayoutObject.cpp b/Source/core/layout/LayoutObject.cpp
index a0226eb958021a42b1e21d3aa65c83f93f9ee12c..22f34b4b5a918548b8158d669f200b8e1dcb3779 100644
--- a/Source/core/layout/LayoutObject.cpp
+++ b/Source/core/layout/LayoutObject.cpp
@@ -669,25 +669,7 @@ LayoutFlowThread* LayoutObject::locateFlowThreadContainingBlock() const
}
// Not in the middle of layout so have to find the thread the slow way.
- LayoutObject* curr = const_cast<LayoutObject*>(this);
- 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;
+ return LayoutFlowThread::locateFlowThreadContainingBlockOf(*this);
}
// FIXME: This could be used when changing the size of a layoutObject without children to skip some invalidations.
« Source/core/layout/LayoutFlowThread.cpp ('K') | « Source/core/layout/LayoutFlowThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698