OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat
e; candidate = candidate->nextSiblingMultiColumnSet()) { | 209 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat
e; candidate = candidate->nextSiblingMultiColumnSet()) { |
210 columnSet = candidate; | 210 columnSet = candidate; |
211 if (candidate->logicalBottom() > blockOffset) | 211 if (candidate->logicalBottom() > blockOffset) |
212 break; | 212 break; |
213 } | 213 } |
214 return columnSet ? columnSet->visualPointToFlowThreadPoint(toLayoutPoint(vis
ualPoint + location() - columnSet->location())) : visualPoint; | 214 return columnSet ? columnSet->visualPointToFlowThreadPoint(toLayoutPoint(vis
ualPoint + location() - columnSet->location())) : visualPoint; |
215 } | 215 } |
216 | 216 |
217 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(Layout
Unit offset) const | 217 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(Layout
Unit offset) const |
218 { | 218 { |
219 if (m_lastSetWorkedOn) { | 219 if (LayoutMultiColumnSet* columnSet = m_lastSetWorkedOn) { |
220 // Layout in progress. We are calculating the set heights as we speak, s
o the column set range | 220 // Layout in progress. We are calculating the set heights as we speak, s
o the column set range |
221 // information is not up-to-date. | 221 // information is not up-to-date. |
222 return m_lastSetWorkedOn; | 222 while (columnSet->logicalTopInFlowThread() > offset) { |
| 223 // Sometimes we have to use a previous set. This happens when we're
working with a block |
| 224 // that contains a spanner (so that there's a column set both before
and after the |
| 225 // spanner, and both sets contain said block). |
| 226 LayoutMultiColumnSet* previousSet = columnSet->previousSiblingMultiC
olumnSet(); |
| 227 if (!previousSet) |
| 228 break; |
| 229 columnSet = previousSet; |
| 230 } |
| 231 return columnSet; |
223 } | 232 } |
224 | 233 |
225 ASSERT(!m_columnSetsInvalidated); | 234 ASSERT(!m_columnSetsInvalidated); |
226 if (m_multiColumnSetList.isEmpty()) | 235 if (m_multiColumnSetList.isEmpty()) |
227 return 0; | 236 return 0; |
228 if (offset <= 0) | 237 if (offset <= 0) |
229 return m_multiColumnSetList.first(); | 238 return m_multiColumnSetList.first(); |
230 | 239 |
231 MultiColumnSetSearchAdapter adapter(offset); | 240 MultiColumnSetSearchAdapter adapter(offset); |
232 m_multiColumnSetIntervalTree.allOverlapsWithAdapter<MultiColumnSetSearchAdap
ter>(adapter); | 241 m_multiColumnSetIntervalTree.allOverlapsWithAdapter<MultiColumnSetSearchAdap
ter>(adapter); |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 } | 753 } |
745 | 754 |
746 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 755 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
747 { | 756 { |
748 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 757 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
749 return columnSet->pageLogicalHeight(); | 758 return columnSet->pageLogicalHeight(); |
750 return false; | 759 return false; |
751 } | 760 } |
752 | 761 |
753 } | 762 } |
OLD | NEW |