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 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r
ights 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
981 // inlineChildrenBlock got reparented to blockChildrenBlock, so it i
s no longer a child | 981 // inlineChildrenBlock got reparented to blockChildrenBlock, so it i
s no longer a child |
982 // of "this". we null out prev or next so that is not used later in
the function. | 982 // of "this". we null out prev or next so that is not used later in
the function. |
983 if (inlineChildrenBlock == prevBlock) | 983 if (inlineChildrenBlock == prevBlock) |
984 prev = 0; | 984 prev = 0; |
985 else | 985 else |
986 next = 0; | 986 next = 0; |
987 } else { | 987 } else { |
988 // Take all the children out of the |next| block and put them in | 988 // Take all the children out of the |next| block and put them in |
989 // the |prev| block. | 989 // the |prev| block. |
990 nextBlock->moveAllChildrenTo(prevBlock, nextBlock->hasLayer() || pre
vBlock->hasLayer()); | 990 nextBlock->moveAllChildrenTo(prevBlock, nextBlock->hasLayer() || pre
vBlock->hasLayer()); |
991 | 991 |
| 992 // FIXME: When we destroy nextBlock, it might happen that nextBlock'
s next sibling block and |
| 993 // oldChild can get merged. Since oldChild is getting removed, we do
not want to move |
| 994 // nextBlock's next sibling block's children into it. By setting a f
ake continuation, |
| 995 // we prevent this from happening. |
| 996 RenderBlock* oldChildBlock = 0; |
| 997 if (oldChild->isAnonymous() && oldChild->isRenderBlock() && !toRende
rBlock(oldChild)->continuation()) { |
| 998 oldChildBlock = toRenderBlock(oldChild); |
| 999 oldChildBlock->setContinuation(oldChildBlock); |
| 1000 } |
| 1001 |
992 // Delete the now-empty block's lines and nuke it. | 1002 // Delete the now-empty block's lines and nuke it. |
993 nextBlock->deleteLineBoxTree(); | 1003 nextBlock->deleteLineBoxTree(); |
994 nextBlock->destroy(); | 1004 nextBlock->destroy(); |
995 next = 0; | 1005 next = 0; |
| 1006 |
| 1007 // FIXME: Revert the continuation change done above. |
| 1008 if (oldChildBlock) |
| 1009 oldChildBlock->setContinuation(0); |
996 } | 1010 } |
997 } | 1011 } |
998 | 1012 |
999 RenderBox::removeChild(oldChild); | 1013 RenderBox::removeChild(oldChild); |
1000 | 1014 |
1001 RenderObject* child = prev ? prev : next; | 1015 RenderObject* child = prev ? prev : next; |
1002 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child-
>nextSibling() && !isFlexibleBox()) { | 1016 if (canMergeAnonymousBlocks && child && !child->previousSibling() && !child-
>nextSibling() && !isFlexibleBox()) { |
1003 // The removal has knocked us down to containing only a single anonymous | 1017 // The removal has knocked us down to containing only a single anonymous |
1004 // box. We can go ahead and pull the content right back up into our | 1018 // box. We can go ahead and pull the content right back up into our |
1005 // box. | 1019 // box. |
(...skipping 5398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6404 else if (isAnonymous()) | 6418 else if (isAnonymous()) |
6405 return "RenderBlock (generated)"; | 6419 return "RenderBlock (generated)"; |
6406 if (isRelPositioned()) | 6420 if (isRelPositioned()) |
6407 return "RenderBlock (relative positioned)"; | 6421 return "RenderBlock (relative positioned)"; |
6408 if (isRunIn()) | 6422 if (isRunIn()) |
6409 return "RenderBlock (run-in)"; | 6423 return "RenderBlock (run-in)"; |
6410 return "RenderBlock"; | 6424 return "RenderBlock"; |
6411 } | 6425 } |
6412 | 6426 |
6413 } // namespace WebCore | 6427 } // namespace WebCore |
OLD | NEW |