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