| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/layout/LayoutPagedFlowThread.h" | 6 #include "core/layout/LayoutPagedFlowThread.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutMultiColumnSet.h" | 8 #include "core/layout/LayoutMultiColumnSet.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 void LayoutPagedFlowThread::layout() | 40 void LayoutPagedFlowThread::layout() |
| 41 { | 41 { |
| 42 ASSERT(firstMultiColumnBox() == lastMultiColumnBox()); // There should eithe
r be zero or one of those for paged layout. | 42 ASSERT(firstMultiColumnBox() == lastMultiColumnBox()); // There should eithe
r be zero or one of those for paged layout. |
| 43 setProgressionIsInline(pagedBlockFlow()->style()->hasInlinePaginationAxis())
; | 43 setProgressionIsInline(pagedBlockFlow()->style()->hasInlinePaginationAxis())
; |
| 44 LayoutMultiColumnFlowThread::layout(); | 44 LayoutMultiColumnFlowThread::layout(); |
| 45 | 45 |
| 46 LayoutMultiColumnSet* columnSet = firstMultiColumnSet(); | 46 LayoutMultiColumnSet* columnSet = firstMultiColumnSet(); |
| 47 if (!columnSet) | 47 if (!columnSet) |
| 48 return; | 48 return; |
| 49 LayoutUnit pageLogicalHeight = columnSet->pageLogicalHeight(); | 49 LayoutUnit pageLogicalHeight = columnSet->pageLogicalHeightForOffset(LayoutU
nit()); |
| 50 if (!pageLogicalHeight) | 50 if (!pageLogicalHeight) |
| 51 return; // Page height not calculated yet. Happens in the first layout p
ass when height is auto. | 51 return; // Page height not calculated yet. Happens in the first layout p
ass when height is auto. |
| 52 // Ensure uniform page height. We don't want the last page to be shorter tha
n the others, | 52 // Ensure uniform page height. We don't want the last page to be shorter tha
n the others, |
| 53 // or it'll be impossible to scroll that whole page into view. | 53 // or it'll be impossible to scroll that whole page into view. |
| 54 LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount()
; | 54 LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount()
; |
| 55 ASSERT(paddedLogicalBottomInFlowThread >= columnSet->logicalBottomInFlowThre
ad()); | 55 ASSERT(paddedLogicalBottomInFlowThread >= columnSet->logicalBottomInFlowThre
ad()); |
| 56 columnSet->endFlow(paddedLogicalBottomInFlowThread); | 56 columnSet->endFlow(paddedLogicalBottomInFlowThread); |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace blink | 59 } // namespace blink |
| OLD | NEW |