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 2339973002: Handle exclusive end offsets when translating from flow thread coordinates. (Closed)
Patch Set: Renamed tests, and fixed typos there. Created 4 years, 3 months 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(LayoutMultiColumnSet&); 63 bool recalculateColumnHeight(LayoutMultiColumnSet&);
64 64
65 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, CoordinateSpaceConversi on) const; 65 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, LayoutBox::PageBoundary Rule, CoordinateSpaceConversion) 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 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const; 70 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const;
71 71
72 // Get the first and the last column intersecting the specified block range. 72 // Get the first and the last column intersecting the specified block range.
73 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. 73 // Note that |logicalBottomInFlowThread| is an exclusive endpoint.
74 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC olumn) const; 74 void columnIntervalForBlockRangeInFlowThread(LayoutUnit logicalTopInFlowThre ad, LayoutUnit logicalBottomInFlowThread, unsigned& firstColumn, unsigned& lastC olumn) const;
75 75
76 // Get the first and the last column intersecting the specified visual recta ngle. 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; 77 void columnIntervalForVisualRect(const LayoutRect&, unsigned& firstColumn, u nsigned& lastColumn) const;
78 78
79 LayoutRect calculateOverflow() const; 79 LayoutRect calculateOverflow() const;
80 80
81 enum ColumnIndexCalculationMode { 81 unsigned columnIndexAtOffset(LayoutUnit offsetInFlowThread, LayoutBox::PageB oundaryRule) const;
82 ClampToExistingColumns, // Stay within the range of already existing col umns.
83 AssumeNewColumns // Allow column indices outside the range of already ex isting columns.
84 };
85 unsigned columnIndexAtOffset(LayoutUnit offsetInFlowThread, ColumnIndexCalcu lationMode = ClampToExistingColumns) const;
86 82
87 // The "CSS actual" value of column-count. This includes overflowing columns , if any. 83 // The "CSS actual" value of column-count. This includes overflowing columns , if any.
88 unsigned actualColumnCount() const; 84 unsigned actualColumnCount() const;
89 85
90 private: 86 private:
91 LayoutUnit heightAdjustedForRowOffset(LayoutUnit height) const; 87 LayoutUnit heightAdjustedForRowOffset(LayoutUnit height) const;
92 LayoutUnit calculateMaxColumnHeight() const; 88 LayoutUnit calculateMaxColumnHeight() const;
93 void setAndConstrainColumnHeight(LayoutUnit); 89 void setAndConstrainColumnHeight(LayoutUnit);
94 90
95 LayoutUnit rebalanceColumnHeightIfNeeded() const; 91 LayoutUnit rebalanceColumnHeightIfNeeded() const;
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 147
152 private: 148 private:
153 LayoutMultiColumnSet& m_columnSet; 149 LayoutMultiColumnSet& m_columnSet;
154 150
155 Vector<MultiColumnFragmentainerGroup, 1> m_groups; 151 Vector<MultiColumnFragmentainerGroup, 1> m_groups;
156 }; 152 };
157 153
158 } // namespace blink 154 } // namespace blink
159 155
160 #endif // MultiColumnFragmentainerGroup_h 156 #endif // MultiColumnFragmentainerGroup_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698