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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons
t | 140 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons
t |
141 { | 141 { |
142 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling->
previousSibling()) { | 142 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling->
previousSibling()) { |
143 if (sibling->isLayoutMultiColumnSet()) | 143 if (sibling->isLayoutMultiColumnSet()) |
144 return toLayoutMultiColumnSet(sibling); | 144 return toLayoutMultiColumnSet(sibling); |
145 } | 145 } |
146 return nullptr; | 146 return nullptr; |
147 } | 147 } |
148 | 148 |
| 149 bool LayoutMultiColumnSet::hasFragmentainerGroupForColumnAt(LayoutUnit offsetInF
lowThread) const |
| 150 { |
| 151 const MultiColumnFragmentainerGroup& lastRow = lastFragmentainerGroup(); |
| 152 if (lastRow.logicalTopInFlowThread() > offsetInFlowThread) |
| 153 return true; |
| 154 return offsetInFlowThread - lastRow.logicalTopInFlowThread() < lastRow.logic
alHeight() * usedColumnCount(); |
| 155 } |
| 156 |
149 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup
() | 157 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup
() |
150 { | 158 { |
151 MultiColumnFragmentainerGroup newGroup(*this); | 159 MultiColumnFragmentainerGroup newGroup(*this); |
152 { // Extra scope here for previousGroup; it's potentially invalid once we mo
dify the m_fragmentainerGroups Vector. | 160 { // Extra scope here for previousGroup; it's potentially invalid once we mo
dify the m_fragmentainerGroups Vector. |
153 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las
t(); | 161 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las
t(); |
154 | 162 |
155 // This is the flow thread block offset where |previousGroup| ends and |
newGroup| takes over. | 163 // This is the flow thread block offset where |previousGroup| ends and |
newGroup| takes over. |
156 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea
d() + previousGroup.logicalHeight() * usedColumnCount(); | 164 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea
d() + previousGroup.logicalHeight() * usedColumnCount(); |
157 previousGroup.setLogicalBottomInFlowThread(blockOffsetInFlowThread); | 165 previousGroup.setLogicalBottomInFlowThread(blockOffsetInFlowThread); |
158 newGroup.setLogicalTopInFlowThread(blockOffsetInFlowThread); | 166 newGroup.setLogicalTopInFlowThread(blockOffsetInFlowThread); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 398 |
391 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const | 399 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const |
392 { | 400 { |
393 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); | 401 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); |
394 if (!isHorizontalWritingMode()) | 402 if (!isHorizontalWritingMode()) |
395 return portionRect.transposedRect(); | 403 return portionRect.transposedRect(); |
396 return portionRect; | 404 return portionRect; |
397 } | 405 } |
398 | 406 |
399 } | 407 } |
OLD | NEW |