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

Side by Side Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 9071019: Merge 102263 - Crash from multicol spans with layers (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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
« no previous file with comments | « LayoutTests/fast/multicol/span/removal-of-multicol-span-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 { 457 {
458 // Create a clone of this inline. 458 // Create a clone of this inline.
459 RenderBlock* cloneBlock = clone(); 459 RenderBlock* cloneBlock = clone();
460 if (!isAnonymousBlock()) 460 if (!isAnonymousBlock())
461 cloneBlock->setContinuation(oldCont); 461 cloneBlock->setContinuation(oldCont);
462 462
463 // Now take all of the children from beforeChild to the end and remove 463 // Now take all of the children from beforeChild to the end and remove
464 // them from |this| and place them in the clone. 464 // them from |this| and place them in the clone.
465 if (!beforeChild && isAfterContent(lastChild())) 465 if (!beforeChild && isAfterContent(lastChild()))
466 beforeChild = lastChild(); 466 beforeChild = lastChild();
467 moveChildrenTo(cloneBlock, beforeChild, 0); 467 moveChildrenTo(cloneBlock, beforeChild, 0, true);
468 468
469 // Hook |clone| up as the continuation of the middle block. 469 // Hook |clone| up as the continuation of the middle block.
470 if (!cloneBlock->isAnonymousBlock()) 470 if (!cloneBlock->isAnonymousBlock())
471 middleBlock->setContinuation(cloneBlock); 471 middleBlock->setContinuation(cloneBlock);
472 472
473 // We have been reparented and are now under the fromBlock. We need 473 // We have been reparented and are now under the fromBlock. We need
474 // to walk up our block parent chain until we hit the containing anonymous c olumns block. 474 // to walk up our block parent chain until we hit the containing anonymous c olumns block.
475 // Once we hit the anonymous columns block we're done. 475 // Once we hit the anonymous columns block we're done.
476 RenderBoxModelObject* curr = toRenderBoxModelObject(parent()); 476 RenderBoxModelObject* curr = toRenderBoxModelObject(parent());
477 RenderBoxModelObject* currChild = this; 477 RenderBoxModelObject* currChild = this;
(...skipping 21 matching lines...) Expand all
499 } 499 }
500 500
501 // Someone may have indirectly caused a <q> to split. When this happens , the :after content 501 // Someone may have indirectly caused a <q> to split. When this happens , the :after content
502 // has to move into the inline continuation. Call updateBeforeAfterCont ent to ensure that the inline's :after 502 // has to move into the inline continuation. Call updateBeforeAfterCont ent to ensure that the inline's :after
503 // content gets properly destroyed. 503 // content gets properly destroyed.
504 if (document()->usesBeforeAfterRules()) 504 if (document()->usesBeforeAfterRules())
505 blockCurr->children()->updateBeforeAfterContent(blockCurr, AFTER); 505 blockCurr->children()->updateBeforeAfterContent(blockCurr, AFTER);
506 506
507 // Now we need to take all of the children starting from the first child 507 // Now we need to take all of the children starting from the first child
508 // *after* currChild and append them all to the clone. 508 // *after* currChild and append them all to the clone.
509 RenderObject* afterContent = isAfterContent(cloneBlock->lastChild()) ? c loneBlock->lastChild() : 0; 509 blockCurr->moveChildrenTo(cloneBlock, currChild->nextSibling(), 0, true) ;
510 blockCurr->moveChildrenTo(cloneBlock, currChild->nextSibling(), 0, after Content);
511 510
512 // Keep walking up the chain. 511 // Keep walking up the chain.
513 currChild = curr; 512 currChild = curr;
514 curr = toRenderBoxModelObject(curr->parent()); 513 curr = toRenderBoxModelObject(curr->parent());
515 } 514 }
516 515
517 // Now we are at the columns block level. We need to put the clone into the toBlock. 516 // Now we are at the columns block level. We need to put the clone into the toBlock.
518 toBlock->children()->appendChildNode(toBlock, cloneBlock); 517 toBlock->children()->appendChildNode(toBlock, cloneBlock);
519 518
520 // Now take all the children after currChild and remove them from the fromBl ock 519 // Now take all the children after currChild and remove them from the fromBl ock
521 // and put them in the toBlock. 520 // and put them in the toBlock.
522 fromBlock->moveChildrenTo(toBlock, currChild->nextSibling(), 0); 521 fromBlock->moveChildrenTo(toBlock, currChild->nextSibling(), 0, true);
523 } 522 }
524 523
525 void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox, 524 void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
526 RenderObject* newChild, RenderBoxModelObject* oldCon t) 525 RenderObject* newChild, RenderBoxModelObject* oldCon t)
527 { 526 {
528 RenderBlock* pre = 0; 527 RenderBlock* pre = 0;
529 RenderBlock* block = containingColumnsBlock(); 528 RenderBlock* block = containingColumnsBlock();
530 529
531 // Delete our line boxes before we do the inline split into continuations. 530 // Delete our line boxes before we do the inline split into continuations.
532 block->deleteLineBoxTree(); 531 block->deleteLineBoxTree();
(...skipping 15 matching lines...) Expand all
548 post->setChildrenInline(false); 547 post->setChildrenInline(false);
549 548
550 RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nex tSibling(); 549 RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nex tSibling();
551 if (madeNewBeforeBlock) 550 if (madeNewBeforeBlock)
552 block->children()->insertChildNode(block, pre, boxFirst); 551 block->children()->insertChildNode(block, pre, boxFirst);
553 block->children()->insertChildNode(block, newBlockBox, boxFirst); 552 block->children()->insertChildNode(block, newBlockBox, boxFirst);
554 block->children()->insertChildNode(block, post, boxFirst); 553 block->children()->insertChildNode(block, post, boxFirst);
555 block->setChildrenInline(false); 554 block->setChildrenInline(false);
556 555
557 if (madeNewBeforeBlock) 556 if (madeNewBeforeBlock)
558 block->moveChildrenTo(pre, boxFirst, 0); 557 block->moveChildrenTo(pre, boxFirst, 0, true);
559 558
560 splitBlocks(pre, post, newBlockBox, beforeChild, oldCont); 559 splitBlocks(pre, post, newBlockBox, beforeChild, oldCont);
561 560
562 // We already know the newBlockBox isn't going to contain inline kids, so av oid wasting 561 // We already know the newBlockBox isn't going to contain inline kids, so av oid wasting
563 // time in makeChildrenNonInline by just setting this explicitly up front. 562 // time in makeChildrenNonInline by just setting this explicitly up front.
564 newBlockBox->setChildrenInline(false); 563 newBlockBox->setChildrenInline(false);
565 564
566 // We delayed adding the newChild until now so that the |newBlockBox| would be fully 565 // We delayed adding the newChild until now so that the |newBlockBox| would be fully
567 // connected, thus allowing newChild access to a renderArena should it need 566 // connected, thus allowing newChild access to a renderArena should it need
568 // to wrap itself in additional boxes (e.g., table construction). 567 // to wrap itself in additional boxes (e.g., table construction).
(...skipping 6493 matching lines...) Expand 10 before | Expand all | Expand 10 after
7062 } 7061 }
7063 7062
7064 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7063 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7065 { 7064 {
7066 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7065 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7067 } 7066 }
7068 7067
7069 #endif 7068 #endif
7070 7069
7071 } // namespace WebCore 7070 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/span/removal-of-multicol-span-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698