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