| 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 "core/layout/LayoutPagedFlowThread.h" | 5 #include "core/layout/LayoutPagedFlowThread.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutMultiColumnSet.h" | 7 #include "core/layout/LayoutMultiColumnSet.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 LayoutPagedFlowThread* LayoutPagedFlowThread::createAnonymous( | 11 LayoutPagedFlowThread* LayoutPagedFlowThread::createAnonymous( |
| 12 Document& document, | 12 Document& document, |
| 13 const ComputedStyle& parentStyle) { | 13 const ComputedStyle& parentStyle) { |
| 14 LayoutPagedFlowThread* pagedFlowThread = new LayoutPagedFlowThread(); | 14 LayoutPagedFlowThread* pagedFlowThread = new LayoutPagedFlowThread(); |
| 15 pagedFlowThread->setDocumentForAnonymous(&document); | 15 pagedFlowThread->setDocumentForAnonymous(&document); |
| 16 pagedFlowThread->setStyle(ComputedStyle::createAnonymousStyleWithDisplay( | 16 pagedFlowThread->setStyle(ComputedStyle::createAnonymousStyleWithDisplay( |
| 17 parentStyle, EDisplay::Block)); | 17 parentStyle, EDisplay::kBlock)); |
| 18 return pagedFlowThread; | 18 return pagedFlowThread; |
| 19 } | 19 } |
| 20 | 20 |
| 21 int LayoutPagedFlowThread::pageCount() { | 21 int LayoutPagedFlowThread::pageCount() { |
| 22 if (LayoutMultiColumnSet* columnSet = firstMultiColumnSet()) | 22 if (LayoutMultiColumnSet* columnSet = firstMultiColumnSet()) |
| 23 return columnSet->actualColumnCount(); | 23 return columnSet->actualColumnCount(); |
| 24 return 1; | 24 return 1; |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool LayoutPagedFlowThread::needsNewWidth() const { | 27 bool LayoutPagedFlowThread::needsNewWidth() const { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 52 // when height is auto. | 52 // when height is auto. |
| 53 // Ensure uniform page height. We don't want the last page to be shorter than | 53 // Ensure uniform page height. We don't want the last page to be shorter than |
| 54 // the others, or it'll be impossible to scroll that whole page into view. | 54 // the others, or it'll be impossible to scroll that whole page into view. |
| 55 LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount(); | 55 LayoutUnit paddedLogicalBottomInFlowThread = pageLogicalHeight * pageCount(); |
| 56 ASSERT(paddedLogicalBottomInFlowThread >= | 56 ASSERT(paddedLogicalBottomInFlowThread >= |
| 57 columnSet->logicalBottomInFlowThread()); | 57 columnSet->logicalBottomInFlowThread()); |
| 58 columnSet->endFlow(paddedLogicalBottomInFlowThread); | 58 columnSet->endFlow(paddedLogicalBottomInFlowThread); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace blink | 61 } // namespace blink |
| OLD | NEW |