| 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 #ifndef MultiColumnFragmentainerGroup_h | 5 #ifndef MultiColumnFragmentainerGroup_h |
| 6 #define MultiColumnFragmentainerGroup_h | 6 #define MultiColumnFragmentainerGroup_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutMultiColumnFlowThread.h" | 8 #include "core/layout/LayoutMultiColumnFlowThread.h" |
| 9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 LayoutUnit logicalHeightInFlowThread() const { return m_logicalBottomInFlowT
hread - m_logicalTopInFlowThread; } | 60 LayoutUnit logicalHeightInFlowThread() const { return m_logicalBottomInFlowT
hread - m_logicalTopInFlowThread; } |
| 61 | 61 |
| 62 void resetColumnHeight(); | 62 void resetColumnHeight(); |
| 63 bool recalculateColumnHeight(LayoutMultiColumnSet&); | 63 bool recalculateColumnHeight(LayoutMultiColumnSet&); |
| 64 | 64 |
| 65 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, CoordinateSpaceConversi
on) const; | 65 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, CoordinateSpaceConversi
on) const; |
| 66 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; | 66 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; |
| 67 LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) con
st; | 67 LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) con
st; |
| 68 LayoutRect fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) c
onst; | 68 LayoutRect fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) c
onst; |
| 69 | 69 |
| 70 void collectLayerFragments(PaintLayerFragments&, const LayoutRect& layerBoun
dingBox, const LayoutRect& dirtyRect) const; | 70 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const; |
| 71 |
| 72 // Get the first and the last column intersecting the specified block range. |
| 73 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. |
| 74 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre
ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC
olumn) const; |
| 75 |
| 76 // Get the first and the last column intersecting the specified visual recta
ngle. |
| 77 void columnIntervalForVisualRect(const LayoutRect&, unsigned& firstColumn, u
nsigned& lastColumn) const; |
| 78 |
| 71 LayoutRect calculateOverflow() const; | 79 LayoutRect calculateOverflow() const; |
| 72 | 80 |
| 73 enum ColumnIndexCalculationMode { | 81 enum ColumnIndexCalculationMode { |
| 74 ClampToExistingColumns, // Stay within the range of already existing col
umns. | 82 ClampToExistingColumns, // Stay within the range of already existing col
umns. |
| 75 AssumeNewColumns // Allow column indices outside the range of already ex
isting columns. | 83 AssumeNewColumns // Allow column indices outside the range of already ex
isting columns. |
| 76 }; | 84 }; |
| 77 unsigned columnIndexAtOffset(LayoutUnit offsetInFlowThread, ColumnIndexCalcu
lationMode = ClampToExistingColumns) const; | 85 unsigned columnIndexAtOffset(LayoutUnit offsetInFlowThread, ColumnIndexCalcu
lationMode = ClampToExistingColumns) const; |
| 78 | 86 |
| 79 // The "CSS actual" value of column-count. This includes overflowing columns
, if any. | 87 // The "CSS actual" value of column-count. This includes overflowing columns
, if any. |
| 80 unsigned actualColumnCount() const; | 88 unsigned actualColumnCount() const; |
| 81 | 89 |
| 82 private: | 90 private: |
| 83 LayoutUnit heightAdjustedForRowOffset(LayoutUnit height) const; | 91 LayoutUnit heightAdjustedForRowOffset(LayoutUnit height) const; |
| 84 LayoutUnit calculateMaxColumnHeight() const; | 92 LayoutUnit calculateMaxColumnHeight() const; |
| 85 void setAndConstrainColumnHeight(LayoutUnit); | 93 void setAndConstrainColumnHeight(LayoutUnit); |
| 86 | 94 |
| 87 LayoutUnit rebalanceColumnHeightIfNeeded() const; | 95 LayoutUnit rebalanceColumnHeightIfNeeded() const; |
| 88 | 96 |
| 89 LayoutRect columnRectAt(unsigned columnIndex) const; | 97 LayoutRect columnRectAt(unsigned columnIndex) const; |
| 90 LayoutUnit logicalTopInFlowThreadAt(unsigned columnIndex) const { return m_l
ogicalTopInFlowThread + columnIndex * m_columnHeight; } | 98 LayoutUnit logicalTopInFlowThreadAt(unsigned columnIndex) const { return m_l
ogicalTopInFlowThread + columnIndex * m_columnHeight; } |
| 91 LayoutRect flowThreadPortionRectAt(unsigned columnIndex) const; | 99 LayoutRect flowThreadPortionRectAt(unsigned columnIndex) const; |
| 92 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const; | |
| 93 | 100 |
| 94 // Return the column that the specified visual point belongs to. Only the co
ordinate on the | 101 // Return the column that the specified visual point belongs to. Only the co
ordinate on the |
| 95 // column progression axis is relevant. Every point belongs to a column, eve
n if said point is | 102 // column progression axis is relevant. Every point belongs to a column, eve
n if said point is |
| 96 // not inside any of the columns. | 103 // not inside any of the columns. |
| 97 unsigned columnIndexAtVisualPoint(const LayoutPoint& visualPoint) const; | 104 unsigned columnIndexAtVisualPoint(const LayoutPoint& visualPoint) const; |
| 98 | 105 |
| 99 // Get the first and the last column intersecting the specified block range. | |
| 100 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. | |
| 101 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre
ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC
olumn) const; | |
| 102 | |
| 103 // Get the first and the last column intersecting the specified visual recta
ngle. | |
| 104 void columnIntervalForVisualRect(const LayoutRect&, unsigned& firstColumn, u
nsigned& lastColumn) const; | |
| 105 | |
| 106 const LayoutMultiColumnSet& m_columnSet; | 106 const LayoutMultiColumnSet& m_columnSet; |
| 107 | 107 |
| 108 LayoutUnit m_logicalTop; | 108 LayoutUnit m_logicalTop; |
| 109 LayoutUnit m_logicalTopInFlowThread; | 109 LayoutUnit m_logicalTopInFlowThread; |
| 110 LayoutUnit m_logicalBottomInFlowThread; | 110 LayoutUnit m_logicalBottomInFlowThread; |
| 111 | 111 |
| 112 LayoutUnit m_columnHeight; | 112 LayoutUnit m_columnHeight; |
| 113 | 113 |
| 114 LayoutUnit m_maxColumnHeight; // Maximum column height allowed. | 114 LayoutUnit m_maxColumnHeight; // Maximum column height allowed. |
| 115 }; | 115 }; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 private: | 152 private: |
| 153 LayoutMultiColumnSet& m_columnSet; | 153 LayoutMultiColumnSet& m_columnSet; |
| 154 | 154 |
| 155 Vector<MultiColumnFragmentainerGroup, 1> m_groups; | 155 Vector<MultiColumnFragmentainerGroup, 1> m_groups; |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace blink | 158 } // namespace blink |
| 159 | 159 |
| 160 #endif // MultiColumnFragmentainerGroup_h | 160 #endif // MultiColumnFragmentainerGroup_h |
| OLD | NEW |