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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 } | 195 } |
196 | 196 |
197 bool LayoutMultiColumnFlowThread::needsNewWidth() const | 197 bool LayoutMultiColumnFlowThread::needsNewWidth() const |
198 { | 198 { |
199 LayoutUnit newWidth; | 199 LayoutUnit newWidth; |
200 unsigned dummyColumnCount; // We only care if used column-width changes. | 200 unsigned dummyColumnCount; // We only care if used column-width changes. |
201 calculateColumnCountAndWidth(newWidth, dummyColumnCount); | 201 calculateColumnCountAndWidth(newWidth, dummyColumnCount); |
202 return newWidth != logicalWidth(); | 202 return newWidth != logicalWidth(); |
203 } | 203 } |
204 | 204 |
| 205 LayoutPoint LayoutMultiColumnFlowThread::visualPointToFlowThreadPoint(const Layo
utPoint& visualPoint) const |
| 206 { |
| 207 LayoutUnit blockOffset = isHorizontalWritingMode() ? visualPoint.y() : visua
lPoint.x(); |
| 208 const LayoutMultiColumnSet* columnSet = nullptr; |
| 209 for (const LayoutMultiColumnSet* candidate = firstMultiColumnSet(); candidat
e; candidate = candidate->nextSiblingMultiColumnSet()) { |
| 210 columnSet = candidate; |
| 211 if (candidate->logicalBottom() > blockOffset) |
| 212 break; |
| 213 } |
| 214 return columnSet ? columnSet->visualPointToFlowThreadPoint(toLayoutPoint(vis
ualPoint + location() - columnSet->location())) : visualPoint; |
| 215 } |
| 216 |
205 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(Layout
Unit offset) const | 217 LayoutMultiColumnSet* LayoutMultiColumnFlowThread::columnSetAtBlockOffset(Layout
Unit offset) const |
206 { | 218 { |
207 if (m_lastSetWorkedOn) { | 219 if (m_lastSetWorkedOn) { |
208 // 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 |
209 // information is not up-to-date. | 221 // information is not up-to-date. |
210 return m_lastSetWorkedOn; | 222 return m_lastSetWorkedOn; |
211 } | 223 } |
212 | 224 |
213 ASSERT(!m_regionsInvalidated); | 225 ASSERT(!m_regionsInvalidated); |
214 if (m_multiColumnSetList.isEmpty()) | 226 if (m_multiColumnSetList.isEmpty()) |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 675 } |
664 | 676 |
665 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 677 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
666 { | 678 { |
667 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 679 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
668 return columnSet->pageLogicalHeight(); | 680 return columnSet->pageLogicalHeight(); |
669 return false; | 681 return false; |
670 } | 682 } |
671 | 683 |
672 } | 684 } |
OLD | NEW |