OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/MultiColumnFragmentainerGroup.h" | 5 #include "core/layout/MultiColumnFragmentainerGroup.h" |
6 | 6 |
7 #include "core/layout/ColumnBalancer.h" | 7 #include "core/layout/ColumnBalancer.h" |
8 #include "core/layout/FragmentationContext.h" | 8 #include "core/layout/FragmentationContext.h" |
9 #include "core/layout/LayoutMultiColumnSet.h" | 9 #include "core/layout/LayoutMultiColumnSet.h" |
10 | 10 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 } | 297 } |
298 | 298 |
299 LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const | 299 LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const |
300 { | 300 { |
301 LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); | 301 LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); |
302 const ComputedStyle& multicolStyle = multicolBlock->styleRef(); | 302 const ComputedStyle& multicolStyle = multicolBlock->styleRef(); |
303 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); | 303 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); |
304 LayoutUnit availableHeight = flowThread->columnHeightAvailable(); | 304 LayoutUnit availableHeight = flowThread->columnHeightAvailable(); |
305 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutUnit:
:max(); | 305 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutUnit:
:max(); |
306 if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { | 306 if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { |
307 LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight
(MaxSize, multicolStyle.logicalMaxHeight(), -1); | 307 LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight
(MaxSize, multicolStyle.logicalMaxHeight(), LayoutUnit(-1)); |
308 if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) | 308 if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) |
309 maxColumnHeight = logicalMaxHeight; | 309 maxColumnHeight = logicalMaxHeight; |
310 } | 310 } |
311 LayoutUnit maxHeight = heightAdjustedForRowOffset(maxColumnHeight); | 311 LayoutUnit maxHeight = heightAdjustedForRowOffset(maxColumnHeight); |
312 if (FragmentationContext* enclosingFragmentationContext = flowThread->enclos
ingFragmentationContext()) { | 312 if (FragmentationContext* enclosingFragmentationContext = flowThread->enclos
ingFragmentationContext()) { |
313 if (enclosingFragmentationContext->isFragmentainerLogicalHeightKnown())
{ | 313 if (enclosingFragmentationContext->isFragmentainerLogicalHeightKnown())
{ |
314 // We're nested inside another fragmentation context whose fragmenta
iner heights are | 314 // We're nested inside another fragmentation context whose fragmenta
iner heights are |
315 // known. This constrains the max height. | 315 // known. This constrains the max height. |
316 LayoutUnit remainingOuterLogicalHeight = enclosingFragmentationConte
xt->remainingLogicalHeightAt(blockOffsetInEnclosingFragmentationContext()); | 316 LayoutUnit remainingOuterLogicalHeight = enclosingFragmentationConte
xt->remainingLogicalHeightAt(blockOffsetInEnclosingFragmentationContext()); |
317 ASSERT(remainingOuterLogicalHeight > 0); | 317 ASSERT(remainingOuterLogicalHeight > 0); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 append(MultiColumnFragmentainerGroup(m_columnSet)); | 539 append(MultiColumnFragmentainerGroup(m_columnSet)); |
540 return last(); | 540 return last(); |
541 } | 541 } |
542 | 542 |
543 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 543 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
544 { | 544 { |
545 shrink(1); | 545 shrink(1); |
546 } | 546 } |
547 | 547 |
548 } // namespace blink | 548 } // namespace blink |
OLD | NEW |