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 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 LayoutUnit contentLogicalTop = m_columnSet.logicalTop() - multicolBlock-
>borderAndPaddingBefore(); | 299 LayoutUnit contentLogicalTop = m_columnSet.logicalTop() - multicolBlock-
>borderAndPaddingBefore(); |
300 height -= contentLogicalTop; | 300 height -= contentLogicalTop; |
301 } | 301 } |
302 height -= logicalTop(); | 302 height -= logicalTop(); |
303 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would
probably cause an infinite amount of columns to be created. | 303 return max(height, LayoutUnit(1)); // Let's avoid zero height, as that would
probably cause an infinite amount of columns to be created. |
304 } | 304 } |
305 | 305 |
306 LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const | 306 LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const |
307 { | 307 { |
308 RenderBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); | 308 RenderBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); |
309 LayoutStyle* multicolStyle = multicolBlock->style(); | 309 const LayoutStyle& multicolStyle = multicolBlock->styleRef(); |
310 LayoutUnit availableHeight = m_columnSet.multiColumnFlowThread()->columnHeig
htAvailable(); | 310 LayoutUnit availableHeight = m_columnSet.multiColumnFlowThread()->columnHeig
htAvailable(); |
311 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutFlowT
hread::maxLogicalHeight(); | 311 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutFlowT
hread::maxLogicalHeight(); |
312 if (!multicolStyle->logicalMaxHeight().isMaxSizeNone()) { | 312 if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { |
313 LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight
(multicolStyle->logicalMaxHeight(), -1); | 313 LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight
(multicolStyle.logicalMaxHeight(), -1); |
314 if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) | 314 if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) |
315 maxColumnHeight = logicalMaxHeight; | 315 maxColumnHeight = logicalMaxHeight; |
316 } | 316 } |
317 return heightAdjustedForRowOffset(maxColumnHeight); | 317 return heightAdjustedForRowOffset(maxColumnHeight); |
318 } | 318 } |
319 | 319 |
320 void MultiColumnFragmentainerGroup::setAndConstrainColumnHeight(LayoutUnit newHe
ight) | 320 void MultiColumnFragmentainerGroup::setAndConstrainColumnHeight(LayoutUnit newHe
ight) |
321 { | 321 { |
322 m_columnHeight = newHeight; | 322 m_columnHeight = newHeight; |
323 if (m_columnHeight > m_maxColumnHeight) | 323 if (m_columnHeight > m_maxColumnHeight) |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 append(MultiColumnFragmentainerGroup(m_columnSet)); | 501 append(MultiColumnFragmentainerGroup(m_columnSet)); |
502 return last(); | 502 return last(); |
503 } | 503 } |
504 | 504 |
505 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 505 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
506 { | 506 { |
507 shrink(1); | 507 shrink(1); |
508 } | 508 } |
509 | 509 |
510 } // namespace blink | 510 } // namespace blink |
OLD | NEW |