| OLD | NEW |
| 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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 } | 700 } |
| 701 curr = curr->parent(); | 701 curr = curr->parent(); |
| 702 } | 702 } |
| 703 } | 703 } |
| 704 } | 704 } |
| 705 return columnsBlockAncestor; | 705 return columnsBlockAncestor; |
| 706 } | 706 } |
| 707 | 707 |
| 708 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
RenderObject* beforeChild) | 708 void RenderBlock::addChildIgnoringAnonymousColumnBlocks(RenderObject* newChild,
RenderObject* beforeChild) |
| 709 { | 709 { |
| 710 // FIXME: We should NEVER hit this code path for tables as they should go th
rough RenderTable::addChild | |
| 711 // to add the appropriate anonymous wrappers. Unfortunately a lot of callers
call this method directly | |
| 712 // (bypassing the virtual addChild), which means we can't enforce this befor
e cleaning them up. | |
| 713 | |
| 714 if (beforeChild && beforeChild->parent() != this) { | 710 if (beforeChild && beforeChild->parent() != this) { |
| 715 RenderObject* beforeChildContainer = beforeChild->parent(); | 711 RenderObject* beforeChildContainer = beforeChild->parent(); |
| 716 while (beforeChildContainer->parent() != this) | 712 while (beforeChildContainer->parent() != this) |
| 717 beforeChildContainer = beforeChildContainer->parent(); | 713 beforeChildContainer = beforeChildContainer->parent(); |
| 718 ASSERT(beforeChildContainer); | 714 ASSERT(beforeChildContainer); |
| 719 | 715 |
| 720 if (beforeChildContainer->isAnonymous()) { | 716 if (beforeChildContainer->isAnonymous()) { |
| 721 // If the requested beforeChild is not one of our children, then thi
s is because | 717 // If the requested beforeChild is not one of our children, then thi
s is because |
| 722 // there is an anonymous container within this object that contains
the beforeChild. | 718 // there is an anonymous container within this object that contains
the beforeChild. |
| 723 RenderObject* beforeChildAnonymousContainer = beforeChildContainer; | 719 RenderObject* beforeChildAnonymousContainer = beforeChildContainer; |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 RenderObject* afterChild = beforeChild ? beforeChild->previousSibling()
: lastChild(); | 800 RenderObject* afterChild = beforeChild ? beforeChild->previousSibling()
: lastChild(); |
| 805 | 801 |
| 806 if (afterChild && afterChild->isAnonymousBlock()) { | 802 if (afterChild && afterChild->isAnonymousBlock()) { |
| 807 afterChild->addChild(newChild); | 803 afterChild->addChild(newChild); |
| 808 return; | 804 return; |
| 809 } | 805 } |
| 810 | 806 |
| 811 if (newChild->isInline()) { | 807 if (newChild->isInline()) { |
| 812 // No suitable existing anonymous box - create a new one. | 808 // No suitable existing anonymous box - create a new one. |
| 813 RenderBlock* newBox = createAnonymousBlock(); | 809 RenderBlock* newBox = createAnonymousBlock(); |
| 814 if (isTable()) | 810 RenderBox::addChild(newBox, beforeChild); |
| 815 toRenderTable(this)->addChild(newBox, beforeChild); | |
| 816 else | |
| 817 RenderBox::addChild(newBox, beforeChild); | |
| 818 newBox->addChild(newChild); | 811 newBox->addChild(newChild); |
| 819 return; | 812 return; |
| 820 } | 813 } |
| 821 } | 814 } |
| 822 | 815 |
| 823 if (isTable()) | 816 RenderBox::addChild(newChild, beforeChild); |
| 824 toRenderTable(this)->addChild(newChild, beforeChild); | |
| 825 else | |
| 826 RenderBox::addChild(newChild, beforeChild); | |
| 827 | 817 |
| 828 if (madeBoxesNonInline && parent() && isAnonymousBlock() && parent()->isRend
erBlock()) | 818 if (madeBoxesNonInline && parent() && isAnonymousBlock() && parent()->isRend
erBlock()) |
| 829 toRenderBlock(parent())->removeLeftoverAnonymousBlock(this); | 819 toRenderBlock(parent())->removeLeftoverAnonymousBlock(this); |
| 830 // this object may be dead here | 820 // this object may be dead here |
| 831 } | 821 } |
| 832 | 822 |
| 833 void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild) | 823 void RenderBlock::addChild(RenderObject* newChild, RenderObject* beforeChild) |
| 834 { | 824 { |
| 835 if (continuation() && !isAnonymousBlock()) | 825 if (continuation() && !isAnonymousBlock()) |
| 836 addChildToContinuation(newChild, beforeChild); | 826 addChildToContinuation(newChild, beforeChild); |
| (...skipping 4964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5801 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const | 5791 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render
Object* obj) const |
| 5802 { | 5792 { |
| 5803 showRenderObject(); | 5793 showRenderObject(); |
| 5804 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 5794 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 5805 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 5795 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 5806 } | 5796 } |
| 5807 | 5797 |
| 5808 #endif | 5798 #endif |
| 5809 | 5799 |
| 5810 } // namespace WebCore | 5800 } // namespace WebCore |
| OLD | NEW |