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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 } | 503 } |
504 | 504 |
505 if (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread, pageBou
ndaryRule)) { | 505 if (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread, pageBou
ndaryRule)) { |
506 FragmentationContext* enclosingFragmentationContext = this->enclosingFra
gmentationContext(); | 506 FragmentationContext* enclosingFragmentationContext = this->enclosingFra
gmentationContext(); |
507 if (!enclosingFragmentationContext) | 507 if (!enclosingFragmentationContext) |
508 return; // Not nested. We'll never need more rows than the one we al
ready have then. | 508 return; // Not nested. We'll never need more rows than the one we al
ready have then. |
509 ASSERT(!isLayoutPagedFlowThread()); | 509 ASSERT(!isLayoutPagedFlowThread()); |
510 | 510 |
511 // We have run out of columns here, so we need to add at least one more
row to hold more | 511 // We have run out of columns here, so we need to add at least one more
row to hold more |
512 // columns. | 512 // columns. |
| 513 LayoutMultiColumnFlowThread* enclosingFlowThread = enclosingFragmentatio
nContext->associatedFlowThread(); |
513 do { | 514 do { |
| 515 if (enclosingFlowThread) { |
| 516 // When we add a new row here, it implicitly means that we're in
serting another |
| 517 // column in our enclosing multicol container. That in turn may
mean that we've run |
| 518 // out of columns there too. Need to insert additional rows in a
ncestral multicol |
| 519 // containers before doing it in the descendants, in order to ge
t the height |
| 520 // constraints right down there. |
| 521 const MultiColumnFragmentainerGroup& lastRow = columnSet->lastFr
agmentainerGroup(); |
| 522 // The top offset where where the new fragmentainer group will s
tart in this column |
| 523 // set, converted to the coordinate space of the enclosing multi
col container. |
| 524 LayoutUnit logicalOffsetInOuter = lastRow.blockOffsetInEnclosing
FragmentationContext() + lastRow.logicalHeight(); |
| 525 enclosingFlowThread->appendNewFragmentainerGroupIfNeeded(logical
OffsetInOuter, AssociateWithLatterPage); |
| 526 } |
| 527 |
514 const MultiColumnFragmentainerGroup& newRow = columnSet->appendNewFr
agmentainerGroup(); | 528 const MultiColumnFragmentainerGroup& newRow = columnSet->appendNewFr
agmentainerGroup(); |
515 // Zero-height rows should really not occur here, but if it does any
way, break, so that | 529 // Zero-height rows should really not occur here, but if it does any
way, break, so that |
516 // we don't get stuck in an infinite loop. | 530 // we don't get stuck in an infinite loop. |
517 ASSERT(newRow.logicalHeight() > 0); | 531 ASSERT(newRow.logicalHeight() > 0); |
518 if (newRow.logicalHeight() <= 0) | 532 if (newRow.logicalHeight() <= 0) |
519 break; | 533 break; |
520 } while (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread
, pageBoundaryRule)); | 534 } while (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread
, pageBoundaryRule)); |
521 | |
522 if (LayoutMultiColumnFlowThread* enclosingFlowThread = enclosingFragment
ationContext->associatedFlowThread()) { | |
523 // When we add a new row here, it implicitly means that we're insert
ing another column | |
524 // in our enclosing multicol container. That in turn may mean that w
e've run out of | |
525 // columns there too. | |
526 const MultiColumnFragmentainerGroup& lastRow = columnSet->lastFragme
ntainerGroup(); | |
527 enclosingFlowThread->appendNewFragmentainerGroupIfNeeded(lastRow.blo
ckOffsetInEnclosingFragmentationContext(), AssociateWithLatterPage); | |
528 } | |
529 } | 535 } |
530 } | 536 } |
531 | 537 |
532 bool LayoutMultiColumnFlowThread::isFragmentainerLogicalHeightKnown() | 538 bool LayoutMultiColumnFlowThread::isFragmentainerLogicalHeightKnown() |
533 { | 539 { |
534 return isPageLogicalHeightKnown(); | 540 return isPageLogicalHeightKnown(); |
535 } | 541 } |
536 | 542 |
537 LayoutUnit LayoutMultiColumnFlowThread::fragmentainerLogicalHeightAt(LayoutUnit
blockOffset) | 543 LayoutUnit LayoutMultiColumnFlowThread::fragmentainerLogicalHeightAt(LayoutUnit
blockOffset) |
538 { | 544 { |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 } | 1020 } |
1015 if (canContainSpannerInParentFragmentationContext(*object)) | 1021 if (canContainSpannerInParentFragmentationContext(*object)) |
1016 next = object->nextInPreOrder(&root); | 1022 next = object->nextInPreOrder(&root); |
1017 else | 1023 else |
1018 next = object->nextInPreOrderAfterChildren(&root); | 1024 next = object->nextInPreOrderAfterChildren(&root); |
1019 } | 1025 } |
1020 return true; | 1026 return true; |
1021 } | 1027 } |
1022 | 1028 |
1023 } // namespace blink | 1029 } // namespace blink |
OLD | NEW |