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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons
t | 172 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons
t |
173 { | 173 { |
174 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling->
previousSibling()) { | 174 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling->
previousSibling()) { |
175 if (sibling->isLayoutMultiColumnSet()) | 175 if (sibling->isLayoutMultiColumnSet()) |
176 return toLayoutMultiColumnSet(sibling); | 176 return toLayoutMultiColumnSet(sibling); |
177 } | 177 } |
178 return nullptr; | 178 return nullptr; |
179 } | 179 } |
180 | 180 |
181 bool LayoutMultiColumnSet::hasFragmentainerGroupForColumnAt(LayoutUnit bottomOff
setInFlowThread) const | 181 bool LayoutMultiColumnSet::hasFragmentainerGroupForColumnAt(LayoutUnit offsetInF
lowThread, PageBoundaryRule pageBoundaryRule) const |
182 { | 182 { |
183 const MultiColumnFragmentainerGroup& lastRow = lastFragmentainerGroup(); | 183 const MultiColumnFragmentainerGroup& lastRow = lastFragmentainerGroup(); |
184 if (lastRow.logicalTopInFlowThread() > bottomOffsetInFlowThread) | 184 LayoutUnit maxLogicalBottomInFlowThread = lastRow.logicalTopInFlowThread() +
lastRow.logicalHeight() * usedColumnCount(); |
185 return true; | 185 if (pageBoundaryRule == AssociateWithFormerPage) |
186 return bottomOffsetInFlowThread - lastRow.logicalTopInFlowThread() <= lastRo
w.logicalHeight() * usedColumnCount(); | 186 return offsetInFlowThread <= maxLogicalBottomInFlowThread; |
| 187 return offsetInFlowThread < maxLogicalBottomInFlowThread; |
187 } | 188 } |
188 | 189 |
189 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup
() | 190 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup
() |
190 { | 191 { |
191 MultiColumnFragmentainerGroup newGroup(*this); | 192 MultiColumnFragmentainerGroup newGroup(*this); |
192 { // Extra scope here for previousGroup; it's potentially invalid once we mo
dify the m_fragmentainerGroups Vector. | 193 { // Extra scope here for previousGroup; it's potentially invalid once we mo
dify the m_fragmentainerGroups Vector. |
193 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las
t(); | 194 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las
t(); |
194 | 195 |
195 // This is the flow thread block offset where |previousGroup| ends and |
newGroup| takes over. | 196 // This is the flow thread block offset where |previousGroup| ends and |
newGroup| takes over. |
196 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea
d() + previousGroup.logicalHeight() * usedColumnCount(); | 197 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea
d() + previousGroup.logicalHeight() * usedColumnCount(); |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 453 |
453 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const | 454 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const |
454 { | 455 { |
455 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); | 456 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi
dth(), logicalHeightInFlowThread()); |
456 if (!isHorizontalWritingMode()) | 457 if (!isHorizontalWritingMode()) |
457 return portionRect.transposedRect(); | 458 return portionRect.transposedRect(); |
458 return portionRect; | 459 return portionRect; |
459 } | 460 } |
460 | 461 |
461 } // namespace blink | 462 } // namespace blink |
OLD | NEW |