Chromium Code Reviews| 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()); |
|
Julien - ping for review
2014/05/07 00:55:17
Doesn't this make the call to applyBreakAfterConte
Julien - ping for review
2014/05/07 01:01:11
Forget this comment, I missed that this change had
| |
| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 604 fragments.append(fragment); | 603 fragments.append(fragment); |
| 605 } | 604 } |
| 606 } | 605 } |
| 607 | 606 |
| 608 const char* RenderMultiColumnSet::renderName() const | 607 const char* RenderMultiColumnSet::renderName() const |
| 609 { | 608 { |
| 610 return "RenderMultiColumnSet"; | 609 return "RenderMultiColumnSet"; |
| 611 } | 610 } |
| 612 | 611 |
| 613 } | 612 } |
| OLD | NEW |