void RenderMultiColumnSet::computeLogicalWidth() { // Our logical width starts off matching the column block itself. // This width will be fixed up after the flow thread lays out once it is determined exactly how many // columns we ended up holding. // FIXME: When we add regions support, we'll start it off at the width of the multi-column // block in that particular region. setLogicalWidth(parentBox()->contentLogicalWidth()); RenderMultiColumnBlock* parentBlock = toRenderMultiColumnBlock(parent()); setComputedColumnWidthAndCount(parentBlock->columnWidth(), parentBlock->columnCount()); // FIXME: This will eventually vary if we are contained inside regions. }
void RenderMultiColumnSet::updateLogicalWidth() { RenderMultiColumnBlock* parentBlock = toRenderMultiColumnBlock(parent()); setComputedColumnWidthAndCount(parentBlock->columnWidth(), parentBlock->columnCount()); // FIXME: This will eventually vary if we are contained inside regions. // FIXME: When we add regions support, we'll start it off at the width of the multi-column // block in that particular region. setLogicalWidth(parentBox()->contentLogicalWidth()); // If we overflow, increase our logical width. unsigned colCount = columnCount(); LayoutUnit colGap = columnGap(); LayoutUnit minimumContentLogicalWidth = colCount * computedColumnWidth() + (colCount - 1) * colGap; LayoutUnit currentContentLogicalWidth = contentLogicalWidth(); LayoutUnit delta = max(LayoutUnit(), minimumContentLogicalWidth - currentContentLogicalWidth); if (!delta) return; // Increase our logical width by the delta. setLogicalWidth(logicalWidth() + delta); }