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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "core/layout/MultiColumnFragmentainerGroup.h" | 7 #include "core/layout/MultiColumnFragmentainerGroup.h" |
8 | 8 |
9 #include "core/layout/LayoutMultiColumnSet.h" | 9 #include "core/layout/LayoutMultiColumnSet.h" |
10 | 10 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would
probably cause an infinite amount of columns to be created. | 330 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would
probably cause an infinite amount of columns to be created. |
331 } | 331 } |
332 | 332 |
333 LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const | 333 LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const |
334 { | 334 { |
335 LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); | 335 LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); |
336 const ComputedStyle& multicolStyle = multicolBlock->styleRef(); | 336 const ComputedStyle& multicolStyle = multicolBlock->styleRef(); |
337 LayoutUnit availableHeight = m_columnSet.multiColumnFlowThread()->columnHeig
htAvailable(); | 337 LayoutUnit availableHeight = m_columnSet.multiColumnFlowThread()->columnHeig
htAvailable(); |
338 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutFlowT
hread::maxLogicalHeight(); | 338 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutFlowT
hread::maxLogicalHeight(); |
339 if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { | 339 if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { |
340 LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight
(multicolStyle.logicalMaxHeight(), -1); | 340 LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight
(MaxSize, multicolStyle.logicalMaxHeight(), -1); |
341 if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) | 341 if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) |
342 maxColumnHeight = logicalMaxHeight; | 342 maxColumnHeight = logicalMaxHeight; |
343 } | 343 } |
344 return heightAdjustedForRowOffset(maxColumnHeight); | 344 return heightAdjustedForRowOffset(maxColumnHeight); |
345 } | 345 } |
346 | 346 |
347 void MultiColumnFragmentainerGroup::setAndConstrainColumnHeight(LayoutUnit newHe
ight) | 347 void MultiColumnFragmentainerGroup::setAndConstrainColumnHeight(LayoutUnit newHe
ight) |
348 { | 348 { |
349 m_columnHeight = newHeight; | 349 m_columnHeight = newHeight; |
350 if (m_columnHeight > m_maxColumnHeight) | 350 if (m_columnHeight > m_maxColumnHeight) |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 append(MultiColumnFragmentainerGroup(m_columnSet)); | 553 append(MultiColumnFragmentainerGroup(m_columnSet)); |
554 return last(); | 554 return last(); |
555 } | 555 } |
556 | 556 |
557 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 557 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
558 { | 558 { |
559 shrink(1); | 559 shrink(1); |
560 } | 560 } |
561 | 561 |
562 } // namespace blink | 562 } // namespace blink |
OLD | NEW |