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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 // fragmentation contexts. They are to be treated as unbreakable content. | 605 // fragmentation contexts. They are to be treated as unbreakable content. |
606 return nullptr; | 606 return nullptr; |
607 } | 607 } |
608 if (multiColumnBlockFlow()->isInsideFlowThread()) | 608 if (multiColumnBlockFlow()->isInsideFlowThread()) |
609 return toLayoutMultiColumnFlowThread( | 609 return toLayoutMultiColumnFlowThread( |
610 locateFlowThreadContainingBlockOf(*multiColumnBlockFlow())); | 610 locateFlowThreadContainingBlockOf(*multiColumnBlockFlow())); |
611 return nullptr; | 611 return nullptr; |
612 } | 612 } |
613 | 613 |
614 FragmentationContext* | 614 FragmentationContext* |
615 LayoutMultiColumnFlowThread::enclosingFragmentationContext() const { | 615 LayoutMultiColumnFlowThread::enclosingFragmentationContext( |
616 if (LayoutMultiColumnFlowThread* enclosingFlowThread = | 616 AncestorSearchConstraint constraint) const { |
617 this->enclosingFlowThread()) | 617 // If this multicol container is strictly unbreakable (due to having |
| 618 // scrollbars, for instance), it's also strictly unbreakable in any outer |
| 619 // fragmentation context. As such, what kind of fragmentation that goes on |
| 620 // inside this multicol container is completely opaque to the ancestors. |
| 621 if (constraint == IsolateUnbreakableContainers && |
| 622 multiColumnBlockFlow()->getPaginationBreakability() == ForbidBreaks) |
| 623 return nullptr; |
| 624 if (auto* enclosingFlowThread = this->enclosingFlowThread()) |
618 return enclosingFlowThread; | 625 return enclosingFlowThread; |
619 return view()->fragmentationContext(); | 626 return view()->fragmentationContext(); |
620 } | 627 } |
621 | 628 |
622 void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded( | 629 void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded( |
623 LayoutUnit offsetInFlowThread, | 630 LayoutUnit offsetInFlowThread, |
624 PageBoundaryRule pageBoundaryRule) { | 631 PageBoundaryRule pageBoundaryRule) { |
625 LayoutMultiColumnSet* columnSet = | 632 LayoutMultiColumnSet* columnSet = |
626 columnSetAtBlockOffset(offsetInFlowThread, pageBoundaryRule); | 633 columnSetAtBlockOffset(offsetInFlowThread, pageBoundaryRule); |
627 if (!columnSet->newFragmentainerGroupsAllowed()) | 634 if (!columnSet->newFragmentainerGroupsAllowed()) |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1370 const { | 1377 const { |
1371 return MultiColumnLayoutState(m_lastSetWorkedOn); | 1378 return MultiColumnLayoutState(m_lastSetWorkedOn); |
1372 } | 1379 } |
1373 | 1380 |
1374 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( | 1381 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( |
1375 const MultiColumnLayoutState& state) { | 1382 const MultiColumnLayoutState& state) { |
1376 m_lastSetWorkedOn = state.columnSet(); | 1383 m_lastSetWorkedOn = state.columnSet(); |
1377 } | 1384 } |
1378 | 1385 |
1379 } // namespace blink | 1386 } // namespace blink |
OLD | NEW |