| 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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 | 1016 |
| 1017 // Make sure the types of the anonymous blocks match up. | 1017 // Make sure the types of the anonymous blocks match up. |
| 1018 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() | 1018 return prev->isAnonymousColumnsBlock() == next->isAnonymousColumnsBlock() |
| 1019 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB
lock(); | 1019 && prev->isAnonymousColumnSpanBlock() == next->isAnonymousColumnSpanB
lock(); |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* c
hild) | 1022 void RenderBlock::collapseAnonymousBoxChild(RenderBlock* parent, RenderObject* c
hild) |
| 1023 { | 1023 { |
| 1024 parent->setNeedsLayoutAndPrefWidthsRecalc(); | 1024 parent->setNeedsLayoutAndPrefWidthsRecalc(); |
| 1025 parent->setChildrenInline(child->childrenInline()); | 1025 parent->setChildrenInline(child->childrenInline()); |
| 1026 RenderObject* nextSibling = child->nextSibling(); |
| 1026 RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(p
arent, child, child->hasLayer())); | 1027 RenderBlock* anonBlock = toRenderBlock(parent->children()->removeChildNode(p
arent, child, child->hasLayer())); |
| 1027 anonBlock->moveAllChildrenTo(parent, child->hasLayer()); | 1028 anonBlock->moveAllChildrenTo(parent, nextSibling, child->hasLayer()); |
| 1028 // Delete the now-empty block's lines and nuke it. | 1029 // Delete the now-empty block's lines and nuke it. |
| 1029 if (!parent->documentBeingDestroyed()) | 1030 if (!parent->documentBeingDestroyed()) |
| 1030 anonBlock->deleteLineBoxTree(); | 1031 anonBlock->deleteLineBoxTree(); |
| 1031 anonBlock->destroy(); | 1032 anonBlock->destroy(); |
| 1032 } | 1033 } |
| 1033 | 1034 |
| 1034 void RenderBlock::removeChild(RenderObject* oldChild) | 1035 void RenderBlock::removeChild(RenderObject* oldChild) |
| 1035 { | 1036 { |
| 1036 // If this child is a block, and if our previous and next siblings are | 1037 // If this child is a block, and if our previous and next siblings are |
| 1037 // both anonymous blocks with inline content, then we can go ahead and | 1038 // both anonymous blocks with inline content, then we can go ahead and |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1081 } | 1082 } |
| 1082 | 1083 |
| 1083 RenderBox::removeChild(oldChild); | 1084 RenderBox::removeChild(oldChild); |
| 1084 | 1085 |
| 1085 RenderObject* child = prev ? prev : next; | 1086 RenderObject* child = prev ? prev : next; |
| 1086 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child-
>nextSibling() && !isFlexibleBoxIncludingDeprecated()) { | 1087 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child-
>nextSibling() && !isFlexibleBoxIncludingDeprecated()) { |
| 1087 // The removal has knocked us down to containing only a single anonymous | 1088 // The removal has knocked us down to containing only a single anonymous |
| 1088 // box. We can go ahead and pull the content right back up into our | 1089 // box. We can go ahead and pull the content right back up into our |
| 1089 // box. | 1090 // box. |
| 1090 collapseAnonymousBoxChild(this, child); | 1091 collapseAnonymousBoxChild(this, child); |
| 1091 } else if ((prev && prev->isAnonymousBlock()) || (next && next->isAnonymousB
lock())) { | 1092 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymous
Block())) && !isFlexibleBoxIncludingDeprecated()) { |
| 1092 // It's possible that the removal has knocked us down to a single anonym
ous | 1093 // It's possible that the removal has knocked us down to a single anonym
ous |
| 1093 // block with pseudo-style element siblings (e.g. first-letter). If thes
e | 1094 // block with pseudo-style element siblings (e.g. first-letter). If thes
e |
| 1094 // are floating, then we need to pull the content up also. | 1095 // are floating, then we need to pull the content up also. |
| 1095 RenderBlock* anonBlock = toRenderBlock((prev && prev->isAnonymousBlock()
) ? prev : next); | 1096 RenderBlock* anonBlock = toRenderBlock((prev && prev->isAnonymousBlock()
) ? prev : next); |
| 1096 if ((anonBlock->previousSibling() || anonBlock->nextSibling()) | 1097 if ((anonBlock->previousSibling() || anonBlock->nextSibling()) |
| 1097 && (!anonBlock->previousSibling() || (anonBlock->previousSibling()->
style()->styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating())) | 1098 && (!anonBlock->previousSibling() || (anonBlock->previousSibling()->
style()->styleType() != NOPSEUDO && anonBlock->previousSibling()->isFloating())) |
| 1098 && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style()-
>styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating()))) { | 1099 && (!anonBlock->nextSibling() || (anonBlock->nextSibling()->style()-
>styleType() != NOPSEUDO && anonBlock->nextSibling()->isFloating()))) { |
| 1099 collapseAnonymousBoxChild(this, anonBlock); | 1100 collapseAnonymousBoxChild(this, anonBlock); |
| 1100 } | 1101 } |
| 1101 } | 1102 } |
| (...skipping 5960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7062 } | 7063 } |
| 7063 | 7064 |
| 7064 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 7065 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
| 7065 { | 7066 { |
| 7066 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 7067 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
| 7067 } | 7068 } |
| 7068 | 7069 |
| 7069 #endif | 7070 #endif |
| 7070 | 7071 |
| 7071 } // namespace WebCore | 7072 } // namespace WebCore |
| OLD | NEW |