Lines Matching refs:beforeChild

313 RenderBlock* RenderBlock::continuationBefore(RenderObject* beforeChild)
315 if (beforeChild && beforeChild->parent() == this)
322 if (beforeChild && beforeChild->parent() == curr) {
323 if (curr->firstChild() == beforeChild)
333 if (!beforeChild && !last->firstChild())
338 void RenderBlock::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild)
340 RenderBlock* flow = continuationBefore(beforeChild);
341 ASSERT(!beforeChild || beforeChild->parent()->isAnonymousColumnSpanBlock() || beforeChild->parent()->isRenderBlock());
343 if (beforeChild)
344 beforeChildParent = toRenderBoxModelObject(beforeChild->parent());
354 return beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
363 return flow->addChildIgnoringContinuation(newChild, beforeChild);
368 return beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
371 return beforeChildParent->addChildIgnoringContinuation(newChild, beforeChild);
375 void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild)
380 RenderBlock* beforeChildParent = toRenderBlock(beforeChild && beforeChild->parent()->isRenderBlock() ? beforeChild->parent() : lastChild());
384 return beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild);
391 return beforeChildParent->addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild);
393 if (!beforeChild) {
401 RenderObject* immediateChild = beforeChild;
412 RenderObject* newBeforeChild = splitAnonymousBlocksAroundChild(beforeChild);
453 RenderObject* beforeChild, RenderBoxModelObject* oldCont)
460 // Now take all of the children from beforeChild to the end and remove
462 if (!beforeChild && isAfterContent(lastChild()))
463 beforeChild = lastChild();
464 moveChildrenTo(cloneBlock, beforeChild, 0);
522 void RenderBlock::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
557 splitBlocks(pre, post, newBlockBox, beforeChild, oldCont);
576 RenderObject* RenderBlock::splitAnonymousBlocksAroundChild(RenderObject* beforeChild)
578 while (beforeChild->parent() != this) {
579 RenderBlock* blockToSplit = toRenderBlock(beforeChild->parent());
580 if (blockToSplit->firstChild() != beforeChild) {
586 blockToSplit->moveChildrenTo(post, beforeChild, 0, blockToSplit->hasLayer());
589 beforeChild = post;
591 beforeChild = blockToSplit;
593 return beforeChild;
596 void RenderBlock::makeChildrenAnonymousColumnBlocks(RenderObject* beforeChild, RenderBlock* newBlockBox, RenderObject* newChild)
606 if (beforeChild && beforeChild->parent() != this)
607 beforeChild = splitAnonymousBlocksAroundChild(beforeChild);
609 if (beforeChild != firstChild()) {
614 if (beforeChild) {
628 block->moveChildrenTo(pre, boxFirst, beforeChild, true);
629 block->moveChildrenTo(post, beforeChild, 0, true);
670 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild, RenderObject* beforeChild)
673 if (!beforeChild) {
676 beforeChild = lastRenderer;
678 beforeChild = lastRenderer->lastChild();
681 // If the requested beforeChild is not one of our children, then this is because
682 // there is an anonymous container within this object that contains the beforeChild.
683 if (beforeChild && beforeChild->parent() != this) {
684 RenderObject* anonymousChild = beforeChild->parent();
694 if (newChild->isInline() || beforeChild->parent()->firstChild() != beforeChild)
695 beforeChild->parent()->addChild(newChild, beforeChild);
697 addChild(newChild, beforeChild->parent());
708 anonymousChild->addChild(newChild, beforeChild);
713 beforeChild = anonymousChild;
731 bool isLastChild = (beforeChild == lastChild());
734 if (isLastChild && beforeChild != lastChild())
735 beforeChild = 0; // We destroyed the last child, so now we need to update our insertion
738 splitFlow(beforeChild, newBox, newChild, oldContinuation);
745 makeChildrenAnonymousColumnBlocks(beforeChild, newBox, newChild);
756 makeChildrenNonInline(beforeChild);
759 if (beforeChild && beforeChild->parent() != this) {
760 beforeChild = beforeChild->parent();
761 ASSERT(beforeChild->isAnonymousBlock());
762 ASSERT(beforeChild->parent() == this);
768 RenderObject* afterChild = beforeChild ? beforeChild->previousSibling() : lastChild();
778 RenderBox::addChild(newBox, beforeChild);
784 RenderBox::addChild(newChild, beforeChild);
791 void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild)
794 return addChildToContinuation(newChild, beforeChild);
795 return addChildIgnoringContinuation(newChild, beforeChild);
798 void RenderBlock::addChildIgnoringContinuation(RenderObject* newChild, RenderObject* beforeChild)
801 return addChildToAnonymousColumnBlocks(newChild, beforeChild);
802 return addChildIgnoringAnonymousColumnBlocks(newChild, beforeChild);
862 void RenderBlock::moveChildTo(RenderBlock* to, RenderObject* child, RenderObject* beforeChild, bool fullRemoveInsert)
865 ASSERT(!beforeChild || to == beforeChild->parent());
866 to->children()->insertChildNode(to, children()->removeChildNode(this, child, fullRemoveInsert), beforeChild, fullRemoveInsert);
869 void RenderBlock::moveChildrenTo(RenderBlock* to, RenderObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool fullRemoveInsert)
871 ASSERT(!beforeChild || to == beforeChild->parent());
876 to->children()->insertChildNode(to, children()->removeChildNode(this, child, fullRemoveInsert), beforeChild, fullRemoveInsert);