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

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

Issue 1399493002: Column balancing refactoring. Don't propagate data during layout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more code review Created 5 years, 2 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 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 bool heightIsAuto() const; 106 bool heightIsAuto() const;
107 107
108 // Find the column that contains the given block offset, and return the tran slation needed to 108 // Find the column that contains the given block offset, and return the tran slation needed to
109 // get from flow thread coordinates to visual coordinates. 109 // get from flow thread coordinates to visual coordinates.
110 LayoutSize flowThreadTranslationAtOffset(LayoutUnit) const; 110 LayoutSize flowThreadTranslationAtOffset(LayoutUnit) const;
111 111
112 LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) con st; 112 LayoutPoint visualPointToFlowThreadPoint(const LayoutPoint& visualPoint) con st;
113 113
114 void updateMinimumColumnHeight(LayoutUnit offsetInFlowThread, LayoutUnit hei ght); 114 void updateMinimumColumnHeight(LayoutUnit offsetInFlowThread, LayoutUnit hei ght);
115 115
116 // Add a content run, specified by its end position. A content run is append ed at every
117 // forced/explicit break and at the end of the column set. The content runs are used to
118 // determine where implicit/soft breaks will occur, in order to calculate an initial column
119 // height.
120 void addContentRun(LayoutUnit endOffsetFromFirstPage);
121
122 // (Re-)calculate the column height if it's auto. This is first and foremost needed by sets that 116 // (Re-)calculate the column height if it's auto. This is first and foremost needed by sets that
123 // are to balance the column height, but even when it isn't to be balanced, this is necessary if 117 // are to balance the column height, but even when it isn't to be balanced, this is necessary if
124 // the multicol container's height is constrained. 118 // the multicol container's height is constrained.
125 bool recalculateColumnHeight(BalancedColumnHeightCalculation); 119 bool recalculateColumnHeight(BalancedColumnHeightCalculation);
126 120
127 // Record space shortage (the amount of space that would have been enough to prevent some
128 // element from being moved to the next column) at a column break. The small est amount of space
129 // shortage we find is the amount with which we will stretch the column heig ht, if it turns out
130 // after layout that the columns weren't tall enough.
131 void recordSpaceShortage(LayoutUnit offsetInFlowThread, LayoutUnit);
132
133 // Reset previously calculated column height. Will mark for layout if needed . 121 // Reset previously calculated column height. Will mark for layout if needed .
134 void resetColumnHeight(); 122 void resetColumnHeight();
135 123
136 // Layout of flow thread content that's to be rendered inside this column se t begins. This 124 // Layout of flow thread content that's to be rendered inside this column se t begins. This
137 // happens at the beginning of flow thread layout, and when advancing from a previous column set 125 // happens at the beginning of flow thread layout, and when advancing from a previous column set
138 // or spanner to this one. 126 // or spanner to this one.
139 void beginFlow(LayoutUnit offsetInFlowThread); 127 void beginFlow(LayoutUnit offsetInFlowThread);
140 128
141 // Layout of flow thread content that was to be rendered inside this column set has 129 // Layout of flow thread content that was to be rendered inside this column set has
142 // finished. This happens at end of flow thread layout, and when advancing t o the next column 130 // finished. This happens at end of flow thread layout, and when advancing t o the next column
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 MultiColumnFragmentainerGroupList m_fragmentainerGroups; 171 MultiColumnFragmentainerGroupList m_fragmentainerGroups;
184 LayoutFlowThread* m_flowThread; 172 LayoutFlowThread* m_flowThread;
185 }; 173 };
186 174
187 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet()); 175 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMultiColumnSet, isLayoutMultiColumnSet());
188 176
189 } // namespace blink 177 } // namespace blink
190 178
191 #endif // LayoutMultiColumnSet_h 179 #endif // LayoutMultiColumnSet_h
192 180
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698