| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 RenderMultiColumnSet::RenderMultiColumnSet(RenderFlowThread* flowThread) | 34 RenderMultiColumnSet::RenderMultiColumnSet(RenderFlowThread* flowThread) |
| 35 : RenderRegion(0, flowThread) | 35 : RenderRegion(0, flowThread) |
| 36 , m_columnHeight(0) | 36 , m_columnHeight(0) |
| 37 , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight()) | 37 , m_maxColumnHeight(RenderFlowThread::maxLogicalHeight()) |
| 38 , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight()) | 38 , m_minSpaceShortage(RenderFlowThread::maxLogicalHeight()) |
| 39 , m_minimumColumnHeight(0) | 39 , m_minimumColumnHeight(0) |
| 40 { | 40 { |
| 41 } | 41 } |
| 42 | 42 |
| 43 RenderMultiColumnSet* RenderMultiColumnSet::createAnonymous(RenderFlowThread* fl
owThread, RenderStyle* parentStyle) | 43 RenderMultiColumnSet* RenderMultiColumnSet::createAnonymous(RenderFlowThread* fl
owThread, const RenderStyle* parentStyle) |
| 44 { | 44 { |
| 45 Document& document = flowThread->document(); | 45 Document& document = flowThread->document(); |
| 46 RenderMultiColumnSet* renderer = new RenderMultiColumnSet(flowThread); | 46 RenderMultiColumnSet* renderer = new RenderMultiColumnSet(flowThread); |
| 47 renderer->setDocumentForAnonymous(&document); | 47 renderer->setDocumentForAnonymous(&document); |
| 48 renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle,
BLOCK)); | 48 renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle,
BLOCK)); |
| 49 return renderer; | 49 return renderer; |
| 50 } | 50 } |
| 51 | 51 |
| 52 RenderMultiColumnSet* RenderMultiColumnSet::nextSiblingMultiColumnSet() const | 52 RenderMultiColumnSet* RenderMultiColumnSet::nextSiblingMultiColumnSet() const |
| 53 { | 53 { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 | 326 |
| 327 void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTo
p, LogicalExtentComputedValues& computedValues) const | 327 void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTo
p, LogicalExtentComputedValues& computedValues) const |
| 328 { | 328 { |
| 329 computedValues.m_extent = m_columnHeight; | 329 computedValues.m_extent = m_columnHeight; |
| 330 computedValues.m_position = logicalTop; | 330 computedValues.m_position = logicalTop; |
| 331 } | 331 } |
| 332 | 332 |
| 333 LayoutUnit RenderMultiColumnSet::calculateMaxColumnHeight() const | 333 LayoutUnit RenderMultiColumnSet::calculateMaxColumnHeight() const |
| 334 { | 334 { |
| 335 RenderBlockFlow* multicolBlock = multiColumnBlockFlow(); | 335 RenderBlockFlow* multicolBlock = multiColumnBlockFlow(); |
| 336 RenderStyle* multicolStyle = multicolBlock->style(); | 336 const RenderStyle* multicolStyle = multicolBlock->style(); |
| 337 LayoutUnit availableHeight = multiColumnFlowThread()->columnHeightAvailable(
); | 337 LayoutUnit availableHeight = multiColumnFlowThread()->columnHeightAvailable(
); |
| 338 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFlowT
hread::maxLogicalHeight(); | 338 LayoutUnit maxColumnHeight = availableHeight ? availableHeight : RenderFlowT
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
(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 heightAdjustedForSetOffset(maxColumnHeight); | 344 return heightAdjustedForSetOffset(maxColumnHeight); |
| 345 } | 345 } |
| 346 | 346 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 | 624 |
| 625 void RenderMultiColumnSet::detachRegion() | 625 void RenderMultiColumnSet::detachRegion() |
| 626 { | 626 { |
| 627 if (m_flowThread) { | 627 if (m_flowThread) { |
| 628 m_flowThread->removeRegionFromThread(this); | 628 m_flowThread->removeRegionFromThread(this); |
| 629 m_flowThread = 0; | 629 m_flowThread = 0; |
| 630 } | 630 } |
| 631 } | 631 } |
| 632 | 632 |
| 633 } | 633 } |
| OLD | NEW |