| 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 #include "core/layout/MultiColumnFragmentainerGroup.h" | 5 #include "core/layout/MultiColumnFragmentainerGroup.h" |
| 6 | 6 |
| 7 namespace blink { | 7 namespace blink { |
| 8 | 8 |
| 9 // A column balancer traverses the portion of the subtree of a flow thread that
belongs to a given | 9 // A column balancer traverses the portion of the subtree of a flow thread that
belongs to a given |
| 10 // fragmentainer group, in order to collect certain data to be used for column b
alancing. This is an | 10 // fragmentainer group, in order to collect certain data to be used for column b
alancing. This is an |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 // so on). There may be several objects that cross the same column boundary,
and we're only | 131 // so on). There may be several objects that cross the same column boundary,
and we're only |
| 132 // interested in the shortest one. For example, when having a float beside r
egular in-flow | 132 // interested in the shortest one. For example, when having a float beside r
egular in-flow |
| 133 // content, we end up with two parallel fragmentation flows [1]. The shortes
t strut found at a | 133 // content, we end up with two parallel fragmentation flows [1]. The shortes
t strut found at a |
| 134 // column boundary is the amount of space that we wasted at said column boun
dary, and it needs | 134 // column boundary is the amount of space that we wasted at said column boun
dary, and it needs |
| 135 // to be deducted when estimating the initial balanced column height, or we
risk making the | 135 // to be deducted when estimating the initial balanced column height, or we
risk making the |
| 136 // column row too tall. An entry set to LayoutUnit::max() means that we didn
't detect any object | 136 // column row too tall. An entry set to LayoutUnit::max() means that we didn
't detect any object |
| 137 // crossing that boundary. | 137 // crossing that boundary. |
| 138 // | 138 // |
| 139 // [1] http://www.w3.org/TR/css3-break/#parallel-flows | 139 // [1] http://www.w3.org/TR/css3-break/#parallel-flows |
| 140 Vector<LayoutUnit, 32> m_shortestStruts; | 140 Vector<LayoutUnit, 32> m_shortestStruts; |
| 141 |
| 142 LayoutUnit m_minimumColumnLogicalHeight; |
| 141 }; | 143 }; |
| 142 | 144 |
| 143 // If we have previously used InitialColumnHeightFinder to estimate an initial c
olumn height, and | 145 // If we have previously used InitialColumnHeightFinder to estimate an initial c
olumn height, and |
| 144 // that didn't result in tall enough columns, we need subsequent layout passes w
here we increase | 146 // that didn't result in tall enough columns, we need subsequent layout passes w
here we increase |
| 145 // the column height by the minimum space shortage at column breaks. This class
finds the minimum | 147 // the column height by the minimum space shortage at column breaks. This class
finds the minimum |
| 146 // space shortage after having laid out with the current column height. | 148 // space shortage after having laid out with the current column height. |
| 147 class MinimumSpaceShortageFinder final : public ColumnBalancer { | 149 class MinimumSpaceShortageFinder final : public ColumnBalancer { |
| 148 public: | 150 public: |
| 149 MinimumSpaceShortageFinder(const MultiColumnFragmentainerGroup&); | 151 MinimumSpaceShortageFinder(const MultiColumnFragmentainerGroup&); |
| 150 | 152 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 169 LayoutUnit m_minimumSpaceShortage; | 171 LayoutUnit m_minimumSpaceShortage; |
| 170 | 172 |
| 171 // Set when breaking before a block, and we're looking for the first unbreak
able descendant, in | 173 // Set when breaking before a block, and we're looking for the first unbreak
able descendant, in |
| 172 // order to report correct space shortage for that one. | 174 // order to report correct space shortage for that one. |
| 173 LayoutUnit m_pendingStrut; | 175 LayoutUnit m_pendingStrut; |
| 174 | 176 |
| 175 unsigned m_forcedBreaksCount; | 177 unsigned m_forcedBreaksCount; |
| 176 }; | 178 }; |
| 177 | 179 |
| 178 } // namespace blink | 180 } // namespace blink |
| OLD | NEW |