LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const { LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); const ComputedStyle& multicolStyle = multicolBlock->styleRef(); LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(); LayoutUnit availableHeight = flowThread->columnHeightAvailable(); LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutUnit::max(); if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), -1); if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) maxColumnHeight = logicalMaxHeight; } LayoutUnit maxHeight = heightAdjustedForRowOffset(maxColumnHeight); if (LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlowThread()) { if (enclosingFlowThread->isPageLogicalHeightKnown()) { // We're nested inside another fragmentation context whose fragmentainer heights are // known. This constrains the max height. LayoutUnit remainingOuterLogicalHeight = enclosingFlowThread->pageRemainingLogicalHeightForOffset(blockOffsetInEnclosingFlowThread(), LayoutBlock::AssociateWithLatterPage); ASSERT(remainingOuterLogicalHeight > 0); if (maxHeight > remainingOuterLogicalHeight) maxHeight = remainingOuterLogicalHeight; } } return maxHeight; }
LayoutUnit MultiColumnFragmentainerGroup::calculateMaxColumnHeight() const { LayoutBlockFlow* multicolBlock = m_columnSet.multiColumnBlockFlow(); const ComputedStyle& multicolStyle = multicolBlock->styleRef(); LayoutUnit availableHeight = m_columnSet.multiColumnFlowThread()->columnHeightAvailable(); LayoutUnit maxColumnHeight = availableHeight ? availableHeight : LayoutUnit::max(); if (!multicolStyle.logicalMaxHeight().isMaxSizeNone()) { LayoutUnit logicalMaxHeight = multicolBlock->computeContentLogicalHeight(MaxSize, multicolStyle.logicalMaxHeight(), -1); if (logicalMaxHeight != -1 && maxColumnHeight > logicalMaxHeight) maxColumnHeight = logicalMaxHeight; } return heightAdjustedForRowOffset(maxColumnHeight); }