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

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

Issue 2590463002: Make column snapping optional when translating to flow thread coordinates. (Closed)
Patch Set: Created 4 years 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 return m_logicalBottomInFlowThread - m_logicalTopInFlowThread; 72 return m_logicalBottomInFlowThread - m_logicalTopInFlowThread;
73 } 73 }
74 74
75 void resetColumnHeight(); 75 void resetColumnHeight();
76 bool recalculateColumnHeight(LayoutMultiColumnSet&); 76 bool recalculateColumnHeight(LayoutMultiColumnSet&);
77 77
78 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, 78 LayoutSize flowThreadTranslationAtOffset(LayoutUnit,
79 LayoutBox::PageBoundaryRule, 79 LayoutBox::PageBoundaryRule,
80 CoordinateSpaceConversion) const; 80 CoordinateSpaceConversion) const;
81 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; 81 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const;
82
83 // If SnapToColumnPolicy is SnapToColumn, visualPointToFlowThreadPoint() won't
84 // return points that lie outside the bounds of the columns: Before converting
85 // to a flow thread position, if the block direction coordinate is outside the
86 // column, snap to the bounds of the column, and reset the inline direction
87 // coordinate to the start position in the column. The effect of this is that
88 // if the block position is before the column rectangle, we'll get to the
89 // beginning of this column, while if the block position is after the column
90 // rectangle, we'll get to the beginning of the next column. This is behavior
91 // that positionForPoint() depends on.
92 enum SnapToColumnPolicy { DontSnapToColumn, SnapToColumn };
szager1 2016/12/19 23:36:44 nit: I prefer not to define an enum for what is ef
mstensho (USE GERRIT) 2016/12/20 08:55:02 A long time ago I learned that this was how to do
82 LayoutPoint visualPointToFlowThreadPoint( 93 LayoutPoint visualPointToFlowThreadPoint(
83 const LayoutPoint& visualPoint) const; 94 const LayoutPoint& visualPoint,
95 SnapToColumnPolicy = DontSnapToColumn) const;
szager1 2016/12/19 23:36:44 It's a bit strange that the default value doesn't
mstensho (USE GERRIT) 2016/12/20 08:55:02 This is exactly what I wanted. The previous behavi
96
84 LayoutRect fragmentsBoundingBox( 97 LayoutRect fragmentsBoundingBox(
85 const LayoutRect& boundingBoxInFlowThread) const; 98 const LayoutRect& boundingBoxInFlowThread) const;
86 99
87 LayoutRect flowThreadPortionRectAt(unsigned columnIndex) const; 100 LayoutRect flowThreadPortionRectAt(unsigned columnIndex) const;
88 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const; 101 LayoutRect flowThreadPortionOverflowRectAt(unsigned columnIndex) const;
89 102
90 // Get the first and the last column intersecting the specified block range. 103 // Get the first and the last column intersecting the specified block range.
91 // Note that |logicalBottomInFlowThread| is an exclusive endpoint. 104 // Note that |logicalBottomInFlowThread| is an exclusive endpoint.
92 void columnIntervalForBlockRangeInFlowThread( 105 void columnIntervalForBlockRangeInFlowThread(
93 LayoutUnit logicalTopInFlowThread, 106 LayoutUnit logicalTopInFlowThread,
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 199
187 private: 200 private:
188 LayoutMultiColumnSet& m_columnSet; 201 LayoutMultiColumnSet& m_columnSet;
189 202
190 Vector<MultiColumnFragmentainerGroup, 1> m_groups; 203 Vector<MultiColumnFragmentainerGroup, 1> m_groups;
191 }; 204 };
192 205
193 } // namespace blink 206 } // namespace blink
194 207
195 #endif // MultiColumnFragmentainerGroup_h 208 #endif // MultiColumnFragmentainerGroup_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698