Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/Source/core/layout/MultiColumnFragmentainerGroup.h

Issue 1420713003: Deduct pagination struts when calculating initial column height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 bool recalculateColumnHeight(BalancedColumnHeightCalculation calculationMode ); 65 bool recalculateColumnHeight(BalancedColumnHeightCalculation calculationMode );
66 66
67 LayoutSize flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) cons t; 67 LayoutSize flowThreadTranslationAtOffset(LayoutUnit offsetInFlowThread) cons t;
68 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; 68 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const;
69 LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) con st; 69 LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) con st;
70 LayoutRect fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) c onst; 70 LayoutRect fragmentsBoundingBox(const LayoutRect& boundingBoxInFlowThread) c onst;
71 71
72 void collectLayerFragments(PaintLayerFragments&, const LayoutRect& layerBoun dingBox, const LayoutRect& dirtyRect) const; 72 void collectLayerFragments(PaintLayerFragments&, const LayoutRect& layerBoun dingBox, const LayoutRect& dirtyRect) const;
73 LayoutRect calculateOverflow() const; 73 LayoutRect calculateOverflow() const;
74 74
75 enum ColumnIndexCalculationMode {
76 ClampToExistingColumns, // Stay within the range of already existing col umns.
77 AssumeNewColumns // Allow column indices outside the range of already ex isting columns.
78 };
79 unsigned columnIndexAtOffset(LayoutUnit offsetInFlowThread, ColumnIndexCalcu lationMode = ClampToExistingColumns) const;
80
75 // The "CSS actual" value of column-count. This includes overflowing columns , if any. 81 // The "CSS actual" value of column-count. This includes overflowing columns , if any.
76 unsigned actualColumnCount() const; 82 unsigned actualColumnCount() const;
77 83
78 private: 84 private:
79 LayoutUnit heightAdjustedForRowOffset(LayoutUnit height) const; 85 LayoutUnit heightAdjustedForRowOffset(LayoutUnit height) const;
80 LayoutUnit calculateMaxColumnHeight() const; 86 LayoutUnit calculateMaxColumnHeight() const;
81 void setAndConstrainColumnHeight(LayoutUnit); 87 void setAndConstrainColumnHeight(LayoutUnit);
82 88
83 LayoutUnit calculateColumnHeight(BalancedColumnHeightCalculation) const; 89 LayoutUnit calculateColumnHeight(BalancedColumnHeightCalculation) const;
84 90
85 LayoutRect columnRectAt(unsigned columnIndex) const; 91 LayoutRect columnRectAt(unsigned columnIndex) const;
86 LayoutUnit logicalTopInFlowThreadAt(unsigned columnIndex) const { return m_l ogicalTopInFlowThread + columnIndex * m_columnHeight; } 92 LayoutUnit logicalTopInFlowThreadAt(unsigned columnIndex) const { return m_l ogicalTopInFlowThread + columnIndex * m_columnHeight; }
87 LayoutRect flowThreadPortionRectAt(unsigned columnIndex) const; 93 LayoutRect flowThreadPortionRectAt(unsigned columnIndex) const;
88 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const; 94 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const;
89 95
90 enum ColumnIndexCalculationMode {
91 ClampToExistingColumns, // Stay within the range of already existing col umns.
92 AssumeNewColumns // Allow column indices outside the range of already ex isting columns.
93 };
94 unsigned columnIndexAtOffset(LayoutUnit offsetInFlowThread, ColumnIndexCalcu lationMode = ClampToExistingColumns) const;
95
96 // Return the column that the specified visual point belongs to. Only the co ordinate on the 96 // Return the column that the specified visual point belongs to. Only the co ordinate on the
97 // column progression axis is relevant. Every point belongs to a column, eve n if said point is 97 // column progression axis is relevant. Every point belongs to a column, eve n if said point is
98 // not inside any of the columns. 98 // not inside any of the columns.
99 unsigned columnIndexAtVisualPoint(const LayoutPoint& visualPoint) const; 99 unsigned columnIndexAtVisualPoint(const LayoutPoint& visualPoint) const;
100 100
101 // Get the first and the last column intersecting the specified block range. 101 // Get the first and the last column intersecting the specified block range.
102 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. 102 // Note that |logicalBottomInFlowThread| is an exclusive endpoint.
103 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC olumn) const; 103 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC olumn) const;
104 104
105 // Get the first and the last column intersecting the specified visual recta ngle. 105 // Get the first and the last column intersecting the specified visual recta ngle.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 private: 156 private:
157 LayoutMultiColumnSet& m_columnSet; 157 LayoutMultiColumnSet& m_columnSet;
158 158
159 Vector<MultiColumnFragmentainerGroup, 1> m_groups; 159 Vector<MultiColumnFragmentainerGroup, 1> m_groups;
160 }; 160 };
161 161
162 } // namespace blink 162 } // namespace blink
163 163
164 #endif // MultiColumnFragmentainerGroup_h 164 #endif // MultiColumnFragmentainerGroup_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698