| 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/ColumnBalancer.h" | 5 #include "core/layout/ColumnBalancer.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutMultiColumnFlowThread.h" | 7 #include "core/layout/LayoutMultiColumnFlowThread.h" |
| 8 #include "core/layout/LayoutMultiColumnSet.h" | 8 #include "core/layout/LayoutMultiColumnSet.h" |
| 9 #include "core/layout/api/LineLayoutBlockFlow.h" | 9 #include "core/layout/api/LineLayoutBlockFlow.h" |
| 10 | 10 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 if (m_shortestStruts[i] != LayoutUnit::max()) | 272 if (m_shortestStruts[i] != LayoutUnit::max()) |
| 273 totalStrutSpace += m_shortestStruts[i]; | 273 totalStrutSpace += m_shortestStruts[i]; |
| 274 } | 274 } |
| 275 return totalStrutSpace; | 275 return totalStrutSpace; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void InitialColumnHeightFinder::addContentRun( | 278 void InitialColumnHeightFinder::addContentRun( |
| 279 LayoutUnit endOffsetInFlowThread) { | 279 LayoutUnit endOffsetInFlowThread) { |
| 280 endOffsetInFlowThread -= spaceUsedByStrutsAt(endOffsetInFlowThread); | 280 endOffsetInFlowThread -= spaceUsedByStrutsAt(endOffsetInFlowThread); |
| 281 if (!m_contentRuns.isEmpty() && | 281 if (!m_contentRuns.isEmpty() && |
| 282 endOffsetInFlowThread <= m_contentRuns.last().breakOffset()) | 282 endOffsetInFlowThread <= m_contentRuns.back().breakOffset()) |
| 283 return; | 283 return; |
| 284 // Append another item as long as we haven't exceeded used column count. What | 284 // Append another item as long as we haven't exceeded used column count. What |
| 285 // ends up in the overflow area shouldn't affect column balancing. However, if | 285 // ends up in the overflow area shouldn't affect column balancing. However, if |
| 286 // we're in a nested fragmentation context, we may still need to record all | 286 // we're in a nested fragmentation context, we may still need to record all |
| 287 // runs, since there'll be no overflow area in the inline direction then, but | 287 // runs, since there'll be no overflow area in the inline direction then, but |
| 288 // rather additional rows of columns in multiple outer fragmentainers. | 288 // rather additional rows of columns in multiple outer fragmentainers. |
| 289 if (m_contentRuns.size() >= columnSet().usedColumnCount()) { | 289 if (m_contentRuns.size() >= columnSet().usedColumnCount()) { |
| 290 const auto* flowThread = columnSet().multiColumnFlowThread(); | 290 const auto* flowThread = columnSet().multiColumnFlowThread(); |
| 291 if (!flowThread->enclosingFragmentationContext() || | 291 if (!flowThread->enclosingFragmentationContext() || |
| 292 columnSet().newFragmentainerGroupsAllowed()) | 292 columnSet().newFragmentainerGroupsAllowed()) |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 if (group.columnLogicalTopForOffset(lineTopInFlowThread) != | 482 if (group.columnLogicalTopForOffset(lineTopInFlowThread) != |
| 483 group.columnLogicalTopForOffset(lineBottomWithOverflow)) { | 483 group.columnLogicalTopForOffset(lineBottomWithOverflow)) { |
| 484 LayoutUnit shortage = | 484 LayoutUnit shortage = |
| 485 lineBottomWithOverflow - | 485 lineBottomWithOverflow - |
| 486 group.columnLogicalTopForOffset(lineBottomWithOverflow); | 486 group.columnLogicalTopForOffset(lineBottomWithOverflow); |
| 487 recordSpaceShortage(shortage); | 487 recordSpaceShortage(shortage); |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace blink | 491 } // namespace blink |
| OLD | NEW |