| 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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 LayoutMultiColumnFlowThread::enclosingFragmentationContext() const { | 584 LayoutMultiColumnFlowThread::enclosingFragmentationContext() const { |
| 585 if (LayoutMultiColumnFlowThread* enclosingFlowThread = | 585 if (LayoutMultiColumnFlowThread* enclosingFlowThread = |
| 586 this->enclosingFlowThread()) | 586 this->enclosingFlowThread()) |
| 587 return enclosingFlowThread; | 587 return enclosingFlowThread; |
| 588 return view()->fragmentationContext(); | 588 return view()->fragmentationContext(); |
| 589 } | 589 } |
| 590 | 590 |
| 591 void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded( | 591 void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded( |
| 592 LayoutUnit offsetInFlowThread, | 592 LayoutUnit offsetInFlowThread, |
| 593 PageBoundaryRule pageBoundaryRule) { | 593 PageBoundaryRule pageBoundaryRule) { |
| 594 if (!isPageLogicalHeightKnown()) { | |
| 595 // If we have no clue about the height of the multicol container, bail. This | |
| 596 // situation occurs initially when an auto-height multicol container is | |
| 597 // nested inside another auto-height multicol container. We need at least an | |
| 598 // estimated height of the outer multicol container before we can check what | |
| 599 // an inner fragmentainer group has room for. | |
| 600 // Its height is indefinite for now. | |
| 601 return; | |
| 602 } | |
| 603 LayoutMultiColumnSet* columnSet = | 594 LayoutMultiColumnSet* columnSet = |
| 604 columnSetAtBlockOffset(offsetInFlowThread, pageBoundaryRule); | 595 columnSetAtBlockOffset(offsetInFlowThread, pageBoundaryRule); |
| 605 if (columnSet->isInitialHeightCalculated()) { | 596 if (!columnSet->newFragmentainerGroupsAllowed()) |
| 606 // We only insert additional fragmentainer groups in the initial layout | |
| 607 // pass. We only want to balance columns in the last fragmentainer group (if | |
| 608 // we need to balance at all), so we want that last fragmentainer group to | |
| 609 // be the same one in all layout passes that follow. | |
| 610 return; | 597 return; |
| 611 } | |
| 612 | 598 |
| 613 if (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread, | 599 if (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread, |
| 614 pageBoundaryRule)) { | 600 pageBoundaryRule)) { |
| 615 FragmentationContext* enclosingFragmentationContext = | 601 FragmentationContext* enclosingFragmentationContext = |
| 616 this->enclosingFragmentationContext(); | 602 this->enclosingFragmentationContext(); |
| 617 // Not nested. We'll never need more rows than the one we already have then. | 603 // Not nested. We'll never need more rows than the one we already have then. |
| 618 if (!enclosingFragmentationContext) | 604 if (!enclosingFragmentationContext) |
| 619 return; | 605 return; |
| 620 ASSERT(!isLayoutPagedFlowThread()); | 606 ASSERT(!isLayoutPagedFlowThread()); |
| 621 | 607 |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 const { | 1320 const { |
| 1335 return MultiColumnLayoutState(m_lastSetWorkedOn); | 1321 return MultiColumnLayoutState(m_lastSetWorkedOn); |
| 1336 } | 1322 } |
| 1337 | 1323 |
| 1338 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( | 1324 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( |
| 1339 const MultiColumnLayoutState& state) { | 1325 const MultiColumnLayoutState& state) { |
| 1340 m_lastSetWorkedOn = state.columnSet(); | 1326 m_lastSetWorkedOn = state.columnSet(); |
| 1341 } | 1327 } |
| 1342 | 1328 |
| 1343 } // namespace blink | 1329 } // namespace blink |
| OLD | NEW |