Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: Source/core/rendering/RenderMultiColumnFlowThread.cpp

Issue 899163003: Move rendering/RenderObject to layout/LayoutObject. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 RenderMultiColumnFlowThread* RenderMultiColumnFlowThread::createAnonymous(Docume nt& document, RenderStyle* parentStyle) 50 RenderMultiColumnFlowThread* RenderMultiColumnFlowThread::createAnonymous(Docume nt& document, RenderStyle* parentStyle)
51 { 51 {
52 RenderMultiColumnFlowThread* renderer = new RenderMultiColumnFlowThread(); 52 RenderMultiColumnFlowThread* renderer = new RenderMultiColumnFlowThread();
53 renderer->setDocumentForAnonymous(&document); 53 renderer->setDocumentForAnonymous(&document);
54 renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK)); 54 renderer->setStyle(RenderStyle::createAnonymousStyleWithDisplay(parentStyle, BLOCK));
55 return renderer; 55 return renderer;
56 } 56 }
57 57
58 RenderMultiColumnSet* RenderMultiColumnFlowThread::firstMultiColumnSet() const 58 RenderMultiColumnSet* RenderMultiColumnFlowThread::firstMultiColumnSet() const
59 { 59 {
60 for (RenderObject* sibling = nextSibling(); sibling; sibling = sibling->next Sibling()) { 60 for (LayoutObject* sibling = nextSibling(); sibling; sibling = sibling->next Sibling()) {
61 if (sibling->isRenderMultiColumnSet()) 61 if (sibling->isRenderMultiColumnSet())
62 return toRenderMultiColumnSet(sibling); 62 return toRenderMultiColumnSet(sibling);
63 } 63 }
64 return 0; 64 return 0;
65 } 65 }
66 66
67 RenderMultiColumnSet* RenderMultiColumnFlowThread::lastMultiColumnSet() const 67 RenderMultiColumnSet* RenderMultiColumnFlowThread::lastMultiColumnSet() const
68 { 68 {
69 for (RenderObject* sibling = multiColumnBlockFlow()->lastChild(); sibling; s ibling = sibling->previousSibling()) { 69 for (LayoutObject* sibling = multiColumnBlockFlow()->lastChild(); sibling; s ibling = sibling->previousSibling()) {
70 if (sibling->isRenderMultiColumnSet()) 70 if (sibling->isRenderMultiColumnSet())
71 return toRenderMultiColumnSet(sibling); 71 return toRenderMultiColumnSet(sibling);
72 } 72 }
73 return 0; 73 return 0;
74 } 74 }
75 75
76 static RenderObject* firstRendererInSet(RenderMultiColumnSet* multicolSet) 76 static LayoutObject* firstRendererInSet(RenderMultiColumnSet* multicolSet)
77 { 77 {
78 RenderBox* sibling = multicolSet->previousSiblingMultiColumnBox(); 78 RenderBox* sibling = multicolSet->previousSiblingMultiColumnBox();
79 if (!sibling) 79 if (!sibling)
80 return multicolSet->flowThread()->firstChild(); 80 return multicolSet->flowThread()->firstChild();
81 // Adjacent column content sets should not occur. We would have no way of fi guring out what each 81 // Adjacent column content sets should not occur. We would have no way of fi guring out what each
82 // of them contains then. 82 // of them contains then.
83 ASSERT(sibling->isRenderMultiColumnSpannerPlaceholder()); 83 ASSERT(sibling->isRenderMultiColumnSpannerPlaceholder());
84 return toRenderMultiColumnSpannerPlaceholder(sibling)->rendererInFlowThread( )->nextInPreOrderAfterChildren(multicolSet->flowThread()); 84 return toRenderMultiColumnSpannerPlaceholder(sibling)->rendererInFlowThread( )->nextInPreOrderAfterChildren(multicolSet->flowThread());
85 } 85 }
86 86
87 static RenderObject* lastRendererInSet(RenderMultiColumnSet* multicolSet) 87 static LayoutObject* lastRendererInSet(RenderMultiColumnSet* multicolSet)
88 { 88 {
89 RenderBox* sibling = multicolSet->nextSiblingMultiColumnBox(); 89 RenderBox* sibling = multicolSet->nextSiblingMultiColumnBox();
90 if (!sibling) 90 if (!sibling)
91 return 0; // By right we should return lastLeafChild() here, but the cal ler doesn't care, so just return 0. 91 return 0; // By right we should return lastLeafChild() here, but the cal ler doesn't care, so just return 0.
92 // Adjacent column content sets should not occur. We would have no way of fi guring out what each 92 // Adjacent column content sets should not occur. We would have no way of fi guring out what each
93 // of them contains then. 93 // of them contains then.
94 ASSERT(sibling->isRenderMultiColumnSpannerPlaceholder()); 94 ASSERT(sibling->isRenderMultiColumnSpannerPlaceholder());
95 return toRenderMultiColumnSpannerPlaceholder(sibling)->rendererInFlowThread( )->previousInPreOrder(multicolSet->flowThread()); 95 return toRenderMultiColumnSpannerPlaceholder(sibling)->rendererInFlowThread( )->previousInPreOrder(multicolSet->flowThread());
96 } 96 }
97 97
98 RenderMultiColumnSet* RenderMultiColumnFlowThread::findSetRendering(RenderObject * renderer) const 98 RenderMultiColumnSet* RenderMultiColumnFlowThread::findSetRendering(LayoutObject * renderer) const
99 { 99 {
100 ASSERT(!containingColumnSpannerPlaceholder(renderer)); // should not be used for spanners or content inside them. 100 ASSERT(!containingColumnSpannerPlaceholder(renderer)); // should not be used for spanners or content inside them.
101 ASSERT(renderer != this); 101 ASSERT(renderer != this);
102 ASSERT(renderer->isDescendantOf(this)); 102 ASSERT(renderer->isDescendantOf(this));
103 RenderMultiColumnSet* multicolSet = firstMultiColumnSet(); 103 RenderMultiColumnSet* multicolSet = firstMultiColumnSet();
104 if (!multicolSet) 104 if (!multicolSet)
105 return 0; 105 return 0;
106 if (!multicolSet->nextSiblingMultiColumnSet()) 106 if (!multicolSet->nextSiblingMultiColumnSet())
107 return multicolSet; 107 return multicolSet;
108 108
109 // This is potentially SLOW! But luckily very uncommon. You would have to dy namically insert a 109 // This is potentially SLOW! But luckily very uncommon. You would have to dy namically insert a
110 // spanner into the middle of column contents to need this. 110 // spanner into the middle of column contents to need this.
111 for (; multicolSet; multicolSet = multicolSet->nextSiblingMultiColumnSet()) { 111 for (; multicolSet; multicolSet = multicolSet->nextSiblingMultiColumnSet()) {
112 RenderObject* firstRenderer = firstRendererInSet(multicolSet); 112 LayoutObject* firstRenderer = firstRendererInSet(multicolSet);
113 RenderObject* lastRenderer = lastRendererInSet(multicolSet); 113 LayoutObject* lastRenderer = lastRendererInSet(multicolSet);
114 ASSERT(firstRenderer); 114 ASSERT(firstRenderer);
115 115
116 for (RenderObject* walker = firstRenderer; walker; walker = walker->next InPreOrder(this)) { 116 for (LayoutObject* walker = firstRenderer; walker; walker = walker->next InPreOrder(this)) {
117 if (walker == renderer) 117 if (walker == renderer)
118 return multicolSet; 118 return multicolSet;
119 if (walker == lastRenderer) 119 if (walker == lastRenderer)
120 break; 120 break;
121 } 121 }
122 } 122 }
123 123
124 return 0; 124 return 0;
125 } 125 }
126 126
127 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnFlowThread::containingColu mnSpannerPlaceholder(const RenderObject* descendant) const 127 RenderMultiColumnSpannerPlaceholder* RenderMultiColumnFlowThread::containingColu mnSpannerPlaceholder(const LayoutObject* descendant) const
128 { 128 {
129 ASSERT(descendant->isDescendantOf(this)); 129 ASSERT(descendant->isDescendantOf(this));
130 130
131 // Before we spend time on searching the ancestry, see if there's a quick wa y to determine 131 // Before we spend time on searching the ancestry, see if there's a quick wa y to determine
132 // whether there might be any spanners at all. 132 // whether there might be any spanners at all.
133 RenderBox* firstBox = firstMultiColumnBox(); 133 RenderBox* firstBox = firstMultiColumnBox();
134 if (!firstBox || (firstBox == lastMultiColumnBox() && firstBox->isRenderMult iColumnSet())) 134 if (!firstBox || (firstBox == lastMultiColumnBox() && firstBox->isRenderMult iColumnSet()))
135 return 0; 135 return 0;
136 136
137 // We have spanners. See if the renderer in question is one or inside of one then. 137 // We have spanners. See if the renderer in question is one or inside of one then.
138 for (const RenderObject* ancestor = descendant; ancestor && ancestor != this ; ancestor = ancestor->parent()) { 138 for (const LayoutObject* ancestor = descendant; ancestor && ancestor != this ; ancestor = ancestor->parent()) {
139 if (RenderMultiColumnSpannerPlaceholder* placeholder = ancestor->spanner Placeholder()) 139 if (RenderMultiColumnSpannerPlaceholder* placeholder = ancestor->spanner Placeholder())
140 return placeholder; 140 return placeholder;
141 } 141 }
142 return 0; 142 return 0;
143 } 143 }
144 144
145 void RenderMultiColumnFlowThread::populate() 145 void RenderMultiColumnFlowThread::populate()
146 { 146 {
147 RenderBlockFlow* multicolContainer = multiColumnBlockFlow(); 147 RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
148 ASSERT(!nextSibling()); 148 ASSERT(!nextSibling());
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 336
337 void RenderMultiColumnFlowThread::createAndInsertSpannerPlaceholder(RenderBox* s panner, RenderBox* insertBefore) 337 void RenderMultiColumnFlowThread::createAndInsertSpannerPlaceholder(RenderBox* s panner, RenderBox* insertBefore)
338 { 338 {
339 RenderBlockFlow* multicolContainer = multiColumnBlockFlow(); 339 RenderBlockFlow* multicolContainer = multiColumnBlockFlow();
340 RenderMultiColumnSpannerPlaceholder* newPlaceholder = RenderMultiColumnSpann erPlaceholder::createAnonymous(multicolContainer->style(), spanner); 340 RenderMultiColumnSpannerPlaceholder* newPlaceholder = RenderMultiColumnSpann erPlaceholder::createAnonymous(multicolContainer->style(), spanner);
341 multicolContainer->RenderBlock::addChild(newPlaceholder, insertBefore); 341 multicolContainer->RenderBlock::addChild(newPlaceholder, insertBefore);
342 spanner->setSpannerPlaceholder(*newPlaceholder); 342 spanner->setSpannerPlaceholder(*newPlaceholder);
343 } 343 }
344 344
345 bool RenderMultiColumnFlowThread::descendantIsValidColumnSpanner(RenderObject* d escendant) const 345 bool RenderMultiColumnFlowThread::descendantIsValidColumnSpanner(LayoutObject* d escendant) const
346 { 346 {
347 // We assume that we're inside the flow thread. This function is not to be c alled otherwise. 347 // We assume that we're inside the flow thread. This function is not to be c alled otherwise.
348 ASSERT(descendant->isDescendantOf(this)); 348 ASSERT(descendant->isDescendantOf(this));
349 349
350 // We're evaluating if the descendant should be turned into a proper spanner . It shouldn't 350 // We're evaluating if the descendant should be turned into a proper spanner . It shouldn't
351 // already be one. 351 // already be one.
352 ASSERT(!descendant->spannerPlaceholder()); 352 ASSERT(!descendant->spannerPlaceholder());
353 353
354 // The spec says that column-span only applies to in-flow block-level elemen ts. 354 // The spec says that column-span only applies to in-flow block-level elemen ts.
355 if (descendant->style()->columnSpan() != ColumnSpanAll || !descendant->isBox () || descendant->isInline() || descendant->isFloatingOrOutOfFlowPositioned()) 355 if (descendant->style()->columnSpan() != ColumnSpanAll || !descendant->isBox () || descendant->isInline() || descendant->isFloatingOrOutOfFlowPositioned())
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 RenderBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox(); 432 RenderBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox();
433 if (nextColumnBox && nextColumnBox->isRenderMultiColumnSet()) { 433 if (nextColumnBox && nextColumnBox->isRenderMultiColumnSet()) {
434 RenderMultiColumnSet* nextSet = toRenderMultiColumnSet(nextColumnBox); 434 RenderMultiColumnSet* nextSet = toRenderMultiColumnSet(nextColumnBox);
435 m_lastSetWorkedOn = nextSet; 435 m_lastSetWorkedOn = nextSet;
436 nextSet->beginFlow(logicalTopInFlowThread); 436 nextSet->beginFlow(logicalTopInFlowThread);
437 } 437 }
438 return adjustment; 438 return adjustment;
439 } 439 }
440 440
441 void RenderMultiColumnFlowThread::flowThreadDescendantWasInserted(RenderObject* descendant) 441 void RenderMultiColumnFlowThread::flowThreadDescendantWasInserted(LayoutObject* descendant)
442 { 442 {
443 ASSERT(!m_isBeingEvacuated); 443 ASSERT(!m_isBeingEvacuated);
444 RenderObject* nextRenderer = descendant->nextInPreOrderAfterChildren(this); 444 LayoutObject* nextRenderer = descendant->nextInPreOrderAfterChildren(this);
445 // This method ensures that the list of column sets and spanner placeholders reflects the 445 // This method ensures that the list of column sets and spanner placeholders reflects the
446 // multicol content after having inserted a descendant (or descendant subtre e). See the header 446 // multicol content after having inserted a descendant (or descendant subtre e). See the header
447 // file for more information. Go through the subtree that was just inserted and create column 447 // file for more information. Go through the subtree that was just inserted and create column
448 // sets (needed by regular column content) and spanner placeholders (one nee ded by each spanner) 448 // sets (needed by regular column content) and spanner placeholders (one nee ded by each spanner)
449 // where needed. 449 // where needed.
450 for (RenderObject* renderer = descendant; renderer; renderer = renderer->nex tInPreOrder(descendant)) { 450 for (LayoutObject* renderer = descendant; renderer; renderer = renderer->nex tInPreOrder(descendant)) {
451 if (containingColumnSpannerPlaceholder(renderer)) 451 if (containingColumnSpannerPlaceholder(renderer))
452 continue; // Inside a column spanner. Nothing to do, then. 452 continue; // Inside a column spanner. Nothing to do, then.
453 if (descendantIsValidColumnSpanner(renderer)) { 453 if (descendantIsValidColumnSpanner(renderer)) {
454 // This renderer is a spanner, so it needs to establish a spanner pl aceholder. 454 // This renderer is a spanner, so it needs to establish a spanner pl aceholder.
455 RenderBox* insertBefore = 0; 455 RenderBox* insertBefore = 0;
456 RenderMultiColumnSet* setToSplit = 0; 456 RenderMultiColumnSet* setToSplit = 0;
457 if (nextRenderer) { 457 if (nextRenderer) {
458 // The spanner is inserted before something. Figure out what thi s entails. If the 458 // The spanner is inserted before something. Figure out what thi s entails. If the
459 // next renderer is a spanner too, it means that we can simply i nsert a new spanner 459 // next renderer is a spanner too, it means that we can simply i nsert a new spanner
460 // placeholder in front of its placeholder. 460 // placeholder in front of its placeholder.
461 insertBefore = nextRenderer->spannerPlaceholder(); 461 insertBefore = nextRenderer->spannerPlaceholder();
462 if (!insertBefore) { 462 if (!insertBefore) {
463 // The next renderer isn't a spanner; it's regular column co ntent. Examine what 463 // The next renderer isn't a spanner; it's regular column co ntent. Examine what
464 // comes right before us in the flow thread, then. 464 // comes right before us in the flow thread, then.
465 RenderObject* previousRenderer = renderer->previousInPreOrde r(this); 465 LayoutObject* previousRenderer = renderer->previousInPreOrde r(this);
466 if (!previousRenderer || previousRenderer == this) { 466 if (!previousRenderer || previousRenderer == this) {
467 // The spanner is inserted as the first child of the mul ticol container, 467 // The spanner is inserted as the first child of the mul ticol container,
468 // which means that we simply insert a new spanner place holder at the 468 // which means that we simply insert a new spanner place holder at the
469 // beginning. 469 // beginning.
470 insertBefore = firstMultiColumnBox(); 470 insertBefore = firstMultiColumnBox();
471 } else if (RenderMultiColumnSpannerPlaceholder* previousPlac eholder = containingColumnSpannerPlaceholder(previousRenderer)) { 471 } else if (RenderMultiColumnSpannerPlaceholder* previousPlac eholder = containingColumnSpannerPlaceholder(previousRenderer)) {
472 // Before us is another spanner. We belong right after i t then. 472 // Before us is another spanner. We belong right after i t then.
473 insertBefore = previousPlaceholder->nextSiblingMultiColu mnBox(); 473 insertBefore = previousPlaceholder->nextSiblingMultiColu mnBox();
474 } else { 474 } else {
475 // We're inside regular column content with both feet. F ind out which column 475 // We're inside regular column content with both feet. F ind out which column
(...skipping 29 matching lines...) Expand all
505 } 505 }
506 } else { 506 } else {
507 // Inserting at the end. Then we just need to make sure that there's a column set at the end. 507 // Inserting at the end. Then we just need to make sure that there's a column set at the end.
508 RenderBox* lastColumnBox = lastMultiColumnBox(); 508 RenderBox* lastColumnBox = lastMultiColumnBox();
509 if (!lastColumnBox || !lastColumnBox->isRenderMultiColumnSet()) 509 if (!lastColumnBox || !lastColumnBox->isRenderMultiColumnSet())
510 createAndInsertMultiColumnSet(); 510 createAndInsertMultiColumnSet();
511 } 511 }
512 } 512 }
513 } 513 }
514 514
515 void RenderMultiColumnFlowThread::flowThreadDescendantWillBeRemoved(RenderObject * descendant) 515 void RenderMultiColumnFlowThread::flowThreadDescendantWillBeRemoved(LayoutObject * descendant)
516 { 516 {
517 // This method ensures that the list of column sets and spanner placeholders reflects the 517 // This method ensures that the list of column sets and spanner placeholders reflects the
518 // multicol content that we'll be left with after removal of a descendant (o r descendant 518 // multicol content that we'll be left with after removal of a descendant (o r descendant
519 // subtree). See the header file for more information. Removing content may mean that we need to 519 // subtree). See the header file for more information. Removing content may mean that we need to
520 // remove column sets and/or spanner placeholders. 520 // remove column sets and/or spanner placeholders.
521 if (m_isBeingEvacuated) 521 if (m_isBeingEvacuated)
522 return; 522 return;
523 bool hadContainingPlaceholder = containingColumnSpannerPlaceholder(descendan t); 523 bool hadContainingPlaceholder = containingColumnSpannerPlaceholder(descendan t);
524 RenderObject* next; 524 LayoutObject* next;
525 // Remove spanner placeholders that are no longer needed, and merge column s ets around them. 525 // Remove spanner placeholders that are no longer needed, and merge column s ets around them.
526 for (RenderObject* renderer = descendant; renderer; renderer = next) { 526 for (LayoutObject* renderer = descendant; renderer; renderer = next) {
527 RenderMultiColumnSpannerPlaceholder* placeholder = renderer->spannerPlac eholder(); 527 RenderMultiColumnSpannerPlaceholder* placeholder = renderer->spannerPlac eholder();
528 if (!placeholder) { 528 if (!placeholder) {
529 next = renderer->nextInPreOrder(descendant); 529 next = renderer->nextInPreOrder(descendant);
530 continue; 530 continue;
531 } 531 }
532 next = renderer->nextInPreOrderAfterChildren(descendant); // It's a span ner. Its children are of no interest to us. 532 next = renderer->nextInPreOrderAfterChildren(descendant); // It's a span ner. Its children are of no interest to us.
533 if (RenderBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox()) { 533 if (RenderBox* nextColumnBox = placeholder->nextSiblingMultiColumnBox()) {
534 RenderBox* previousColumnBox = placeholder->previousSiblingMultiColu mnBox(); 534 RenderBox* previousColumnBox = placeholder->previousSiblingMultiColu mnBox();
535 if (nextColumnBox && nextColumnBox->isRenderMultiColumnSet() 535 if (nextColumnBox && nextColumnBox->isRenderMultiColumnSet()
536 && previousColumnBox && previousColumnBox->isRenderMultiColumnSe t()) { 536 && previousColumnBox && previousColumnBox->isRenderMultiColumnSe t()) {
537 // Need to merge two column sets. 537 // Need to merge two column sets.
538 nextColumnBox->destroy(); 538 nextColumnBox->destroy();
539 previousColumnBox->setNeedsLayout(); 539 previousColumnBox->setNeedsLayout();
540 invalidateRegions(); 540 invalidateRegions();
541 } 541 }
542 } 542 }
543 placeholder->destroy(); 543 placeholder->destroy();
544 } 544 }
545 if (hadContainingPlaceholder) 545 if (hadContainingPlaceholder)
546 return; // We're only removing a spanner (or something inside one), whic h means that no column content will be removed. 546 return; // We're only removing a spanner (or something inside one), whic h means that no column content will be removed.
547 547
548 // Column content will be removed. Does this mean that we should destroy a c olumn set? 548 // Column content will be removed. Does this mean that we should destroy a c olumn set?
549 RenderMultiColumnSpannerPlaceholder* adjacentPreviousSpannerPlaceholder = 0; 549 RenderMultiColumnSpannerPlaceholder* adjacentPreviousSpannerPlaceholder = 0;
550 RenderObject* previousRenderer = descendant->previousInPreOrder(this); 550 LayoutObject* previousRenderer = descendant->previousInPreOrder(this);
551 if (previousRenderer && previousRenderer != this) { 551 if (previousRenderer && previousRenderer != this) {
552 adjacentPreviousSpannerPlaceholder = containingColumnSpannerPlaceholder( previousRenderer); 552 adjacentPreviousSpannerPlaceholder = containingColumnSpannerPlaceholder( previousRenderer);
553 if (!adjacentPreviousSpannerPlaceholder) 553 if (!adjacentPreviousSpannerPlaceholder)
554 return; // Preceded by column content. Set still needed. 554 return; // Preceded by column content. Set still needed.
555 } 555 }
556 RenderMultiColumnSpannerPlaceholder* adjacentNextSpannerPlaceholder = 0; 556 RenderMultiColumnSpannerPlaceholder* adjacentNextSpannerPlaceholder = 0;
557 RenderObject* nextRenderer = descendant->nextInPreOrderAfterChildren(this); 557 LayoutObject* nextRenderer = descendant->nextInPreOrderAfterChildren(this);
558 if (nextRenderer) { 558 if (nextRenderer) {
559 adjacentNextSpannerPlaceholder = containingColumnSpannerPlaceholder(next Renderer); 559 adjacentNextSpannerPlaceholder = containingColumnSpannerPlaceholder(next Renderer);
560 if (!adjacentNextSpannerPlaceholder) 560 if (!adjacentNextSpannerPlaceholder)
561 return; // Followed by column content. Set still needed. 561 return; // Followed by column content. Set still needed.
562 } 562 }
563 // We have now determined that, with the removal of |descendant|, we should remove a column 563 // We have now determined that, with the removal of |descendant|, we should remove a column
564 // set. Locate it and remove it. Do it without involving findSetRendering(), as that might be 564 // set. Locate it and remove it. Do it without involving findSetRendering(), as that might be
565 // very slow. Deduce the right set from the spanner placeholders that we've already found. 565 // very slow. Deduce the right set from the spanner placeholders that we've already found.
566 RenderMultiColumnSet* columnSetToRemove; 566 RenderMultiColumnSet* columnSetToRemove;
567 if (adjacentNextSpannerPlaceholder) { 567 if (adjacentNextSpannerPlaceholder) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 if (RenderMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) 649 if (RenderMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset))
650 multicolSet->recordSpaceShortage(spaceShortage); 650 multicolSet->recordSpaceShortage(spaceShortage);
651 } 651 }
652 652
653 void RenderMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay outUnit minHeight) 653 void RenderMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay outUnit minHeight)
654 { 654 {
655 if (RenderMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) 655 if (RenderMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset))
656 multicolSet->updateMinimumColumnHeight(minHeight); 656 multicolSet->updateMinimumColumnHeight(minHeight);
657 } 657 }
658 658
659 bool RenderMultiColumnFlowThread::addForcedRegionBreak(LayoutUnit offset, Render Object* /*breakChild*/, bool /*isBefore*/, LayoutUnit* offsetBreakAdjustment) 659 bool RenderMultiColumnFlowThread::addForcedRegionBreak(LayoutUnit offset, Layout Object* /*breakChild*/, bool /*isBefore*/, LayoutUnit* offsetBreakAdjustment)
660 { 660 {
661 if (RenderMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) { 661 if (RenderMultiColumnSet* multicolSet = columnSetAtBlockOffset(offset)) {
662 multicolSet->addContentRun(offset); 662 multicolSet->addContentRun(offset);
663 if (offsetBreakAdjustment) 663 if (offsetBreakAdjustment)
664 *offsetBreakAdjustment = pageLogicalHeightForOffset(offset) ? pageRe mainingLogicalHeightForOffset(offset, IncludePageBoundary) : LayoutUnit(); 664 *offsetBreakAdjustment = pageLogicalHeightForOffset(offset) ? pageRe mainingLogicalHeightForOffset(offset, IncludePageBoundary) : LayoutUnit();
665 return true; 665 return true;
666 } 666 }
667 return false; 667 return false;
668 } 668 }
669 669
670 bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const 670 bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const
671 { 671 {
672 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet()) 672 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet())
673 return columnSet->pageLogicalHeight(); 673 return columnSet->pageLogicalHeight();
674 return false; 674 return false;
675 } 675 }
676 676
677 } 677 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMultiColumnFlowThread.h ('k') | Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698