Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 // | 22 // |
| 23 // Each fragmentainer group may have its own actual column count (if there are u nused columns | 23 // Each fragmentainer group may have its own actual column count (if there are u nused columns |
| 24 // because of forced breaks, for example). If there are multiple fragmentainer g roups, the actual | 24 // because of forced breaks, for example). If there are multiple fragmentainer g roups, the actual |
| 25 // column count must not exceed the used column count (the one calculated based on column-count and | 25 // column count must not exceed the used column count (the one calculated based on column-count and |
| 26 // column-width from CSS), or they'd overflow the outer fragmentainer in the inl ine direction. If we | 26 // column-width from CSS), or they'd overflow the outer fragmentainer in the inl ine direction. If we |
| 27 // need more columns than what a group has room for, we'll create another group and put them there | 27 // need more columns than what a group has room for, we'll create another group and put them there |
| 28 // (and make them appear in the next outer fragmentainer). | 28 // (and make them appear in the next outer fragmentainer). |
| 29 class MultiColumnFragmentainerGroup { | 29 class MultiColumnFragmentainerGroup { |
| 30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 31 public: | 31 public: |
| 32 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); | 32 MultiColumnFragmentainerGroup(const LayoutMultiColumnSet&); |
| 33 | 33 |
| 34 const LayoutMultiColumnSet& columnSet() const { return m_columnSet; } | 34 const LayoutMultiColumnSet& columnSet() const { return m_columnSet; } |
| 35 | 35 |
| 36 bool isFirstGroup() const; | 36 bool isFirstGroup() const; |
| 37 bool isLastGroup() const; | 37 bool isLastGroup() const; |
| 38 | 38 |
| 39 // Position within the LayoutMultiColumnSet. | 39 // Position within the LayoutMultiColumnSet. |
| 40 LayoutUnit logicalTop() const { return m_logicalTop; } | 40 LayoutUnit logicalTop() const { return m_logicalTop; } |
| 41 void setLogicalTop(LayoutUnit logicalTop) { m_logicalTop = logicalTop; } | 41 void setLogicalTop(LayoutUnit logicalTop) { m_logicalTop = logicalTop; } |
| 42 | 42 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 53 void setLogicalTopInFlowThread(LayoutUnit logicalTopInFlowThread) { m_logica lTopInFlowThread = logicalTopInFlowThread; } | 53 void setLogicalTopInFlowThread(LayoutUnit logicalTopInFlowThread) { m_logica lTopInFlowThread = logicalTopInFlowThread; } |
| 54 | 54 |
| 55 // The bottom of our flow thread portion | 55 // The bottom of our flow thread portion |
| 56 LayoutUnit logicalBottomInFlowThread() const { return m_logicalBottomInFlowT hread; } | 56 LayoutUnit logicalBottomInFlowThread() const { return m_logicalBottomInFlowT hread; } |
| 57 void setLogicalBottomInFlowThread(LayoutUnit logicalBottomInFlowThread) { AS SERT(logicalBottomInFlowThread >= m_logicalTopInFlowThread); m_logicalBottomInFl owThread = logicalBottomInFlowThread; } | 57 void setLogicalBottomInFlowThread(LayoutUnit logicalBottomInFlowThread) { AS SERT(logicalBottomInFlowThread >= m_logicalTopInFlowThread); m_logicalBottomInFl owThread = logicalBottomInFlowThread; } |
| 58 | 58 |
| 59 // The height of our flow thread portion | 59 // The height of our flow thread portion |
| 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(); | 63 bool recalculateColumnHeight(LayoutMultiColumnSet&); |
|
mstensho (USE GERRIT)
2016/04/19 19:07:39
So, how silly is this? I need a non-const referenc
leviw_travelin_and_unemployed
2016/04/19 19:57:50
It's silly, but I don't have better solutions. I'd
| |
| 64 | 64 |
| 65 LayoutSize flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) cons t; | 65 LayoutSize flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) cons t; |
| 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 void collectLayerFragments(PaintLayerFragments&, const LayoutRect& layerBoun dingBox, const LayoutRect& dirtyRect) const; |
| 71 LayoutRect calculateOverflow() const; | 71 LayoutRect calculateOverflow() const; |
| 72 | 72 |
| 73 enum ColumnIndexCalculationMode { | 73 enum ColumnIndexCalculationMode { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 96 // not inside any of the columns. | 96 // not inside any of the columns. |
| 97 unsigned columnIndexAtVisualPoint(const LayoutPoint& visualPoint) const; | 97 unsigned columnIndexAtVisualPoint(const LayoutPoint& visualPoint) const; |
| 98 | 98 |
| 99 // Get the first and the last column intersecting the specified block range. | 99 // Get the first and the last column intersecting the specified block range. |
| 100 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. | 100 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. |
| 101 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC olumn) const; | 101 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC olumn) const; |
| 102 | 102 |
| 103 // Get the first and the last column intersecting the specified visual recta ngle. | 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; | 104 void columnIntervalForVisualRect(const LayoutRect&, unsigned& firstColumn, u nsigned& lastColumn) const; |
| 105 | 105 |
| 106 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 }; |
| 116 | 116 |
| (...skipping 34 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 |