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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 236 |
237 void InitialColumnHeightFinder::examineLine(const RootInlineBox& line) { | 237 void InitialColumnHeightFinder::examineLine(const RootInlineBox& line) { |
238 LayoutUnit lineTop = line.lineTopWithLeading(); | 238 LayoutUnit lineTop = line.lineTopWithLeading(); |
239 LayoutUnit lineTopInFlowThread = flowThreadOffset() + lineTop; | 239 LayoutUnit lineTopInFlowThread = flowThreadOffset() + lineTop; |
240 LayoutUnit minimumLogialHeight = | 240 LayoutUnit minimumLogialHeight = |
241 columnLogicalHeightRequirementForLine(line.block().styleRef(), line); | 241 columnLogicalHeightRequirementForLine(line.block().styleRef(), line); |
242 if (lineTopInFlowThread < LayoutUnit()) | 242 if (lineTopInFlowThread < LayoutUnit()) |
243 minimumLogialHeight += lineTopInFlowThread; | 243 minimumLogialHeight += lineTopInFlowThread; |
244 m_tallestUnbreakableLogicalHeight = | 244 m_tallestUnbreakableLogicalHeight = |
245 std::max(m_tallestUnbreakableLogicalHeight, minimumLogialHeight); | 245 std::max(m_tallestUnbreakableLogicalHeight, minimumLogialHeight); |
246 DCHECK( | |
247 isFirstAfterBreak(lineTopInFlowThread) || !line.paginationStrut() || | |
248 !isLogicalTopWithinBounds(lineTopInFlowThread - line.paginationStrut())); | |
249 if (isFirstAfterBreak(lineTopInFlowThread) && | 246 if (isFirstAfterBreak(lineTopInFlowThread) && |
250 m_lastBreakSeen != lineTopInFlowThread) { | 247 m_lastBreakSeen != lineTopInFlowThread) { |
251 m_lastBreakSeen = lineTopInFlowThread; | 248 m_lastBreakSeen = lineTopInFlowThread; |
252 recordStrutBeforeOffset(lineTopInFlowThread, line.paginationStrut()); | 249 recordStrutBeforeOffset(lineTopInFlowThread, line.paginationStrut()); |
253 } | 250 } |
254 } | 251 } |
255 | 252 |
256 void InitialColumnHeightFinder::recordStrutBeforeOffset( | 253 void InitialColumnHeightFinder::recordStrutBeforeOffset( |
257 LayoutUnit offsetInFlowThread, | 254 LayoutUnit offsetInFlowThread, |
258 LayoutUnit strut) { | 255 LayoutUnit strut) { |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 if (group.columnLogicalTopForOffset(lineTopInFlowThread) != | 487 if (group.columnLogicalTopForOffset(lineTopInFlowThread) != |
491 group.columnLogicalTopForOffset(lineBottomWithOverflow)) { | 488 group.columnLogicalTopForOffset(lineBottomWithOverflow)) { |
492 LayoutUnit shortage = | 489 LayoutUnit shortage = |
493 lineBottomWithOverflow - | 490 lineBottomWithOverflow - |
494 group.columnLogicalTopForOffset(lineBottomWithOverflow); | 491 group.columnLogicalTopForOffset(lineBottomWithOverflow); |
495 recordSpaceShortage(shortage); | 492 recordSpaceShortage(shortage); |
496 } | 493 } |
497 } | 494 } |
498 | 495 |
499 } // namespace blink | 496 } // namespace blink |
OLD | NEW |