| 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 17 matching lines...) Expand all Loading... |
| 28 #define RenderMultiColumnFlowThread_h | 28 #define RenderMultiColumnFlowThread_h |
| 29 | 29 |
| 30 #include "core/rendering/RenderFlowThread.h" | 30 #include "core/rendering/RenderFlowThread.h" |
| 31 | 31 |
| 32 namespace WebCore { | 32 namespace WebCore { |
| 33 | 33 |
| 34 class RenderMultiColumnFlowThread FINAL : public RenderFlowThread { | 34 class RenderMultiColumnFlowThread FINAL : public RenderFlowThread { |
| 35 public: | 35 public: |
| 36 virtual ~RenderMultiColumnFlowThread(); | 36 virtual ~RenderMultiColumnFlowThread(); |
| 37 | 37 |
| 38 static RenderMultiColumnFlowThread* createAnonymous(Document*); | 38 static RenderMultiColumnFlowThread* createAnonymous(Document&, RenderStyle*
parentStyle); |
| 39 |
| 40 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par
ent()); } |
| 41 unsigned columnCount() const { return m_columnCount; } |
| 42 LayoutUnit columnWidth() const { return m_columnWidth; } |
| 43 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } |
| 44 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } |
| 45 bool requiresBalancing() const { return !columnHeightAvailable() || multiCol
umnBlockFlow()->style()->columnFill() == ColumnFillBalance; } |
| 46 |
| 47 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); |
| 48 bool computeColumnCountAndWidth(); |
| 49 bool recalculateColumnHeights(); |
| 39 | 50 |
| 40 private: | 51 private: |
| 41 RenderMultiColumnFlowThread(); | 52 RenderMultiColumnFlowThread(); |
| 42 | 53 |
| 43 virtual const char* renderName() const OVERRIDE; | 54 virtual const char* renderName() const OVERRIDE; |
| 44 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 55 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; |
| 45 virtual void autoGenerateRegionsToBlockOffset(LayoutUnit) OVERRIDE; | 56 virtual void autoGenerateRegionsToBlockOffset(LayoutUnit) OVERRIDE; |
| 46 virtual LayoutUnit initialLogicalWidth() const OVERRIDE; | 57 virtual LayoutUnit initialLogicalWidth() const OVERRIDE; |
| 47 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; | 58 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; |
| 48 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; | 59 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; |
| 49 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) OVERRIDE; | 60 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) OVERRIDE; |
| 61 |
| 62 unsigned m_columnCount; // The used value of column-count |
| 63 LayoutUnit m_columnWidth; // The used value of column-width |
| 64 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
| 65 bool m_inBalancingPass; // Set when relayouting for column balancing. |
| 66 bool m_needsRebalancing; |
| 50 }; | 67 }; |
| 51 | 68 |
| 52 } // namespace WebCore | 69 } // namespace WebCore |
| 53 | 70 |
| 54 #endif // RenderMultiColumnFlowThread_h | 71 #endif // RenderMultiColumnFlowThread_h |
| 55 | 72 |
| OLD | NEW |