| 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 insertBefore = firstMultiColumnBox(); | 477 insertBefore = firstMultiColumnBox(); |
| 478 } else if (LayoutMultiColumnSpannerPlaceholder* previousPlac
eholder = containingColumnSpannerPlaceholder(previousRenderer)) { | 478 } else if (LayoutMultiColumnSpannerPlaceholder* previousPlac
eholder = containingColumnSpannerPlaceholder(previousRenderer)) { |
| 479 // Before us is another spanner. We belong right after i
t then. | 479 // Before us is another spanner. We belong right after i
t then. |
| 480 insertBefore = previousPlaceholder->nextSiblingMultiColu
mnBox(); | 480 insertBefore = previousPlaceholder->nextSiblingMultiColu
mnBox(); |
| 481 } else { | 481 } else { |
| 482 // We're inside regular column content with both feet. F
ind out which column | 482 // We're inside regular column content with both feet. F
ind out which column |
| 483 // set this is. It needs to be split it into two sets, s
o that we can insert | 483 // set this is. It needs to be split it into two sets, s
o that we can insert |
| 484 // a new spanner placeholder between them. | 484 // a new spanner placeholder between them. |
| 485 setToSplit = findSetRendering(previousRenderer); | 485 setToSplit = findSetRendering(previousRenderer); |
| 486 ASSERT(setToSplit == findSetRendering(nextRenderer)); | 486 ASSERT(setToSplit == findSetRendering(nextRenderer)); |
| 487 setToSplit->setNeedsLayoutAndFullPaintInvalidation(); | 487 setToSplit->setNeedsLayoutAndFullPaintInvalidation(Layou
tInvalidationReason::ColumnsChanged); |
| 488 insertBefore = setToSplit->nextSiblingMultiColumnBox(); | 488 insertBefore = setToSplit->nextSiblingMultiColumnBox(); |
| 489 // We've found out which set that needs to be split. Now
proceed to | 489 // We've found out which set that needs to be split. Now
proceed to |
| 490 // inserting the spanner placeholder, and then insert a
second column set. | 490 // inserting the spanner placeholder, and then insert a
second column set. |
| 491 } | 491 } |
| 492 } | 492 } |
| 493 ASSERT(setToSplit || insertBefore); | 493 ASSERT(setToSplit || insertBefore); |
| 494 } | 494 } |
| 495 createAndInsertSpannerPlaceholder(toLayoutBox(renderer), insertBefor
e); | 495 createAndInsertSpannerPlaceholder(toLayoutBox(renderer), insertBefor
e); |
| 496 if (setToSplit) | 496 if (setToSplit) |
| 497 createAndInsertMultiColumnSet(insertBefore); | 497 createAndInsertMultiColumnSet(insertBefore); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 next = renderer->nextInPreOrder(descendant); | 536 next = renderer->nextInPreOrder(descendant); |
| 537 continue; | 537 continue; |
| 538 } | 538 } |
| 539 next = renderer->nextInPreOrderAfterChildren(descendant); // It's a span
ner. Its children are of no interest to us. | 539 next = renderer->nextInPreOrderAfterChildren(descendant); // It's a span
ner. Its children are of no interest to us. |
| 540 if (LayoutBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox())
{ | 540 if (LayoutBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox())
{ |
| 541 LayoutBox* previousColumnBox = placeholder->previousSiblingMultiColu
mnBox(); | 541 LayoutBox* previousColumnBox = placeholder->previousSiblingMultiColu
mnBox(); |
| 542 if (nextColumnBox && nextColumnBox->isLayoutMultiColumnSet() | 542 if (nextColumnBox && nextColumnBox->isLayoutMultiColumnSet() |
| 543 && previousColumnBox && previousColumnBox->isLayoutMultiColumnSe
t()) { | 543 && previousColumnBox && previousColumnBox->isLayoutMultiColumnSe
t()) { |
| 544 // Need to merge two column sets. | 544 // Need to merge two column sets. |
| 545 nextColumnBox->destroy(); | 545 nextColumnBox->destroy(); |
| 546 previousColumnBox->setNeedsLayout(); | 546 previousColumnBox->setNeedsLayout(LayoutInvalidationReason::Colu
mnsChanged); |
| 547 invalidateRegions(); | 547 invalidateRegions(); |
| 548 } | 548 } |
| 549 } | 549 } |
| 550 placeholder->destroy(); | 550 placeholder->destroy(); |
| 551 } | 551 } |
| 552 if (hadContainingPlaceholder) | 552 if (hadContainingPlaceholder) |
| 553 return; // We're only removing a spanner (or something inside one), whic
h means that no column content will be removed. | 553 return; // We're only removing a spanner (or something inside one), whic
h means that no column content will be removed. |
| 554 | 554 |
| 555 // Column content will be removed. Does this mean that we should destroy a c
olumn set? | 555 // Column content will be removed. Does this mean that we should destroy a c
olumn set? |
| 556 LayoutMultiColumnSpannerPlaceholder* adjacentPreviousSpannerPlaceholder = 0; | 556 LayoutMultiColumnSpannerPlaceholder* adjacentPreviousSpannerPlaceholder = 0; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 } | 675 } |
| 676 | 676 |
| 677 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const | 677 bool LayoutMultiColumnFlowThread::isPageLogicalHeightKnown() const |
| 678 { | 678 { |
| 679 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) | 679 if (LayoutMultiColumnSet* columnSet = lastMultiColumnSet()) |
| 680 return columnSet->pageLogicalHeight(); | 680 return columnSet->pageLogicalHeight(); |
| 681 return false; | 681 return false; |
| 682 } | 682 } |
| 683 | 683 |
| 684 } | 684 } |
| OLD | NEW |