| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 ASSERT(offsetInFlowThread.mightBeSaturated()); | 157 ASSERT(offsetInFlowThread.mightBeSaturated()); |
| 158 remainingLogicalHeight = pageLogicalHeight; | 158 remainingLogicalHeight = pageLogicalHeight; |
| 159 } | 159 } |
| 160 return remainingLogicalHeight; | 160 return remainingLogicalHeight; |
| 161 } | 161 } |
| 162 | 162 |
| 163 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const { | 163 bool LayoutMultiColumnSet::isPageLogicalHeightKnown() const { |
| 164 return firstFragmentainerGroup().logicalHeight(); | 164 return firstFragmentainerGroup().logicalHeight(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 bool LayoutMultiColumnSet::newFragmentainerGroupsAllowed() const { |
| 168 if (!isPageLogicalHeightKnown()) { |
| 169 // If we have no clue about the height of the multicol container, bail. This |
| 170 // situation occurs initially when an auto-height multicol container is |
| 171 // nested inside another auto-height multicol container. We need at least an |
| 172 // estimated height of the outer multicol container before we can check what |
| 173 // an inner fragmentainer group has room for. |
| 174 // Its height is indefinite for now. |
| 175 return false; |
| 176 } |
| 177 if (isInitialHeightCalculated()) { |
| 178 // We only insert additional fragmentainer groups in the initial layout |
| 179 // pass. We only want to balance columns in the last fragmentainer group (if |
| 180 // we need to balance at all), so we want that last fragmentainer group to |
| 181 // be the same one in all layout passes that follow. |
| 182 return false; |
| 183 } |
| 184 return true; |
| 185 } |
| 186 |
| 167 LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent( | 187 LayoutUnit LayoutMultiColumnSet::nextLogicalTopForUnbreakableContent( |
| 168 LayoutUnit flowThreadOffset, | 188 LayoutUnit flowThreadOffset, |
| 169 LayoutUnit contentLogicalHeight) const { | 189 LayoutUnit contentLogicalHeight) const { |
| 170 ASSERT(flowThreadOffset.mightBeSaturated() || | 190 ASSERT(flowThreadOffset.mightBeSaturated() || |
| 171 pageLogicalTopForOffset(flowThreadOffset) == flowThreadOffset); | 191 pageLogicalTopForOffset(flowThreadOffset) == flowThreadOffset); |
| 172 FragmentationContext* enclosingFragmentationContext = | 192 FragmentationContext* enclosingFragmentationContext = |
| 173 multiColumnFlowThread()->enclosingFragmentationContext(); | 193 multiColumnFlowThread()->enclosingFragmentationContext(); |
| 174 if (!enclosingFragmentationContext) { | 194 if (!enclosingFragmentationContext) { |
| 175 // If there's no enclosing fragmentation context, there'll ever be only one | 195 // If there's no enclosing fragmentation context, there'll ever be only one |
| 176 // row, and all columns there will have the same height. | 196 // row, and all columns there will have the same height. |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // Now add in column rule bounds, if present. | 626 // Now add in column rule bounds, if present. |
| 607 Vector<LayoutRect> columnRuleBounds; | 627 Vector<LayoutRect> columnRuleBounds; |
| 608 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { | 628 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { |
| 609 for (auto& bound : columnRuleBounds) | 629 for (auto& bound : columnRuleBounds) |
| 610 blockFlowBounds.unite(bound); | 630 blockFlowBounds.unite(bound); |
| 611 } | 631 } |
| 612 return blockFlowBounds; | 632 return blockFlowBounds; |
| 613 } | 633 } |
| 614 | 634 |
| 615 } // namespace blink | 635 } // namespace blink |
| OLD | NEW |