OLD | NEW |
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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 largestHeight = height; | 111 largestHeight = height; |
112 indexWithLargestHeight = i; | 112 indexWithLargestHeight = i; |
113 } | 113 } |
114 previousOffset = run.breakOffset(); | 114 previousOffset = run.breakOffset(); |
115 } | 115 } |
116 return indexWithLargestHeight; | 116 return indexWithLargestHeight; |
117 } | 117 } |
118 | 118 |
119 void RenderMultiColumnSet::distributeImplicitBreaks() | 119 void RenderMultiColumnSet::distributeImplicitBreaks() |
120 { | 120 { |
121 unsigned breakCount = forcedBreaksCount(); | |
122 | |
123 #ifndef NDEBUG | 121 #ifndef NDEBUG |
124 // There should be no implicit breaks assumed at this point. | 122 // There should be no implicit breaks assumed at this point. |
125 for (unsigned i = 0; i < breakCount; i++) | 123 for (unsigned i = 0; i < forcedBreaksCount(); i++) |
126 ASSERT(!m_contentRuns[i].assumedImplicitBreaks()); | 124 ASSERT(!m_contentRuns[i].assumedImplicitBreaks()); |
127 #endif // NDEBUG | 125 #endif // NDEBUG |
128 | 126 |
129 // There will always be at least one break, since the flow thread reports a
"forced break" at | 127 // Insert a final content run to encompass all content. This will include ov
erflow if this is |
130 // end of content. | 128 // the last set. |
131 ASSERT(breakCount >= 1); | 129 addForcedBreak(logicalBottomInFlowThread()); |
| 130 unsigned breakCount = forcedBreaksCount(); |
132 | 131 |
133 // If there is room for more breaks (to reach the used value of column-count
), imagine that we | 132 // If there is room for more breaks (to reach the used value of column-count
), imagine that we |
134 // insert implicit breaks at suitable locations. At any given time, the cont
ent run with the | 133 // insert implicit breaks at suitable locations. At any given time, the cont
ent run with the |
135 // currently tallest columns will get another implicit break "inserted", whi
ch will increase its | 134 // currently tallest columns will get another implicit break "inserted", whi
ch will increase its |
136 // column count by one and shrink its columns' height. Repeat until we have
the desired total | 135 // column count by one and shrink its columns' height. Repeat until we have
the desired total |
137 // number of breaks. The largest column height among the runs will then be t
he initial column | 136 // number of breaks. The largest column height among the runs will then be t
he initial column |
138 // height for the balancer to use. | 137 // height for the balancer to use. |
139 while (breakCount < m_computedColumnCount) { | 138 while (breakCount < m_computedColumnCount) { |
140 unsigned index = findRunWithTallestColumns(); | 139 unsigned index = findRunWithTallestColumns(); |
141 m_contentRuns[index].assumeAnotherImplicitBreak(); | 140 m_contentRuns[index].assumeAnotherImplicitBreak(); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 fragments.append(fragment); | 620 fragments.append(fragment); |
622 } | 621 } |
623 } | 622 } |
624 | 623 |
625 const char* RenderMultiColumnSet::renderName() const | 624 const char* RenderMultiColumnSet::renderName() const |
626 { | 625 { |
627 return "RenderMultiColumnSet"; | 626 return "RenderMultiColumnSet"; |
628 } | 627 } |
629 | 628 |
630 } | 629 } |
OLD | NEW |