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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutFlowThread.h ('k') | Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 25 matching lines...) Expand all
36 36
37 namespace blink { 37 namespace blink {
38 38
39 LayoutFlowThread::LayoutFlowThread() 39 LayoutFlowThread::LayoutFlowThread()
40 : LayoutBlockFlow(nullptr) 40 : LayoutBlockFlow(nullptr)
41 , m_columnSetsInvalidated(false) 41 , m_columnSetsInvalidated(false)
42 , m_pageLogicalSizeChanged(false) 42 , m_pageLogicalSizeChanged(false)
43 { 43 {
44 } 44 }
45 45
46 LayoutFlowThread* LayoutFlowThread::locateFlowThreadContainingBlockOf(const Layo utObject& descendant)
47 {
48 ASSERT(descendant.isInsideFlowThread());
49 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
50 while (curr) {
51 if (curr->isSVG() && !curr->isSVGRoot())
52 return nullptr;
53 if (curr->isLayoutFlowThread())
54 return toLayoutFlowThread(curr);
55 LayoutObject* container = curr->container();
56 curr = curr->parent();
57 while (curr != container) {
58 if (curr->isLayoutFlowThread()) {
59 // The nearest ancestor flow thread isn't in our containing bloc k chain. Then we
60 // aren't really part of any flow thread, and we should stop loo king. This happens
61 // when there are out-of-flow objects or column spanners.
62 return nullptr;
63 }
64 curr = curr->parent();
65 }
66 }
67 return nullptr;
68 }
69
46 void LayoutFlowThread::removeColumnSetFromThread(LayoutMultiColumnSet* columnSet ) 70 void LayoutFlowThread::removeColumnSetFromThread(LayoutMultiColumnSet* columnSet )
47 { 71 {
48 ASSERT(columnSet); 72 ASSERT(columnSet);
49 m_multiColumnSetList.remove(columnSet); 73 m_multiColumnSetList.remove(columnSet);
50 invalidateColumnSets(); 74 invalidateColumnSets();
51 // Clear the interval tree right away, instead of leaving it around with dea d objects. Not that 75 // Clear the interval tree right away, instead of leaving it around with dea d objects. Not that
52 // anyone _should_ try to access the interval tree when the column sets are marked as invalid, 76 // anyone _should_ try to access the interval tree when the column sets are marked as invalid,
53 // but this is actually possible if other parts of the engine has bugs that cause us to not lay 77 // but this is actually possible if other parts of the engine has bugs that cause us to not lay
54 // out everything that was marked for layout, so that LayoutObject::assertLa idOut() (and a LOT 78 // out everything that was marked for layout, so that LayoutObject::assertLa idOut() (and a LOT
55 // of other assertions) fails. 79 // of other assertions) fails.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 206
183 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC olumnSetInterval& interval) 207 void LayoutFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC olumnSetInterval& interval)
184 { 208 {
185 if (m_result) 209 if (m_result)
186 return; 210 return;
187 if (interval.low() <= m_offset && interval.high() > m_offset) 211 if (interval.low() <= m_offset && interval.high() > m_offset)
188 m_result = interval.data(); 212 m_result = interval.data();
189 } 213 }
190 214
191 } // namespace blink 215 } // namespace blink
OLDNEW
« 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