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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 RenderBlock* renderer = new (document->renderArena()) RenderBlock(0); | 270 RenderBlock* renderer = new (document->renderArena()) RenderBlock(0); |
271 renderer->setDocumentForAnonymous(document); | 271 renderer->setDocumentForAnonymous(document); |
272 return renderer; | 272 return renderer; |
273 } | 273 } |
274 | 274 |
275 void RenderBlock::willBeDestroyed() | 275 void RenderBlock::willBeDestroyed() |
276 { | 276 { |
277 // Mark as being destroyed to avoid trouble with merges in removeChild(). | 277 // Mark as being destroyed to avoid trouble with merges in removeChild(). |
278 m_beingDestroyed = true; | 278 m_beingDestroyed = true; |
279 | 279 |
| 280 if (!documentBeingDestroyed()) { |
| 281 if (firstChild() && firstChild()->isRunIn()) |
| 282 moveRunInToOriginalPosition(firstChild()); |
| 283 } |
| 284 |
280 // Make sure to destroy anonymous children first while they are still connec
ted to the rest of the tree, so that they will | 285 // Make sure to destroy anonymous children first while they are still connec
ted to the rest of the tree, so that they will |
281 // properly dirty line boxes that they are removed from. Effects that do :be
fore/:after only on hover could crash otherwise. | 286 // properly dirty line boxes that they are removed from. Effects that do :be
fore/:after only on hover could crash otherwise. |
282 children()->destroyLeftoverChildren(); | 287 children()->destroyLeftoverChildren(); |
283 | 288 |
284 // Destroy our continuation before anything other than anonymous children. | 289 // Destroy our continuation before anything other than anonymous children. |
285 // The reason we don't destroy it before anonymous children is that they may | 290 // The reason we don't destroy it before anonymous children is that they may |
286 // have continuations of their own that are anonymous children of our contin
uation. | 291 // have continuations of their own that are anonymous children of our contin
uation. |
287 RenderBoxModelObject* continuation = this->continuation(); | 292 RenderBoxModelObject* continuation = this->continuation(); |
288 if (continuation) { | 293 if (continuation) { |
289 continuation->destroy(); | 294 continuation->destroy(); |
(...skipping 1682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1972 | 1977 |
1973 // Check if this node is allowed to run-in. E.g. <select> expects its render
er to | 1978 // Check if this node is allowed to run-in. E.g. <select> expects its render
er to |
1974 // be a RenderListBox or RenderMenuList, and hence cannot be a RenderInline
run-in. | 1979 // be a RenderListBox or RenderMenuList, and hence cannot be a RenderInline
run-in. |
1975 if (!runIn->canBeReplacedWithInlineRunIn()) | 1980 if (!runIn->canBeReplacedWithInlineRunIn()) |
1976 return; | 1981 return; |
1977 | 1982 |
1978 RenderObject* curr = runIn->nextSibling(); | 1983 RenderObject* curr = runIn->nextSibling(); |
1979 if (!curr || !curr->isRenderBlock() || !curr->childrenInline()) | 1984 if (!curr || !curr->isRenderBlock() || !curr->childrenInline()) |
1980 return; | 1985 return; |
1981 | 1986 |
| 1987 if (toRenderBlock(curr)->beingDestroyed()) |
| 1988 return; |
| 1989 |
1982 // Per CSS3, "A run-in cannot run in to a block that already starts with a | 1990 // Per CSS3, "A run-in cannot run in to a block that already starts with a |
1983 // run-in or that itself is a run-in". | 1991 // run-in or that itself is a run-in". |
1984 if (curr->isRunIn() || (curr->firstChild() && curr->firstChild()->isRunIn())
) | 1992 if (curr->isRunIn() || (curr->firstChild() && curr->firstChild()->isRunIn())
) |
1985 return; | 1993 return; |
1986 | 1994 |
1987 if (curr->isAnonymous() || curr->isFloatingOrOutOfFlowPositioned()) | 1995 if (curr->isAnonymous() || curr->isFloatingOrOutOfFlowPositioned()) |
1988 return; | 1996 return; |
1989 | 1997 |
1990 // FIXME: We don't support run-ins with or as part of a continuation | 1998 // FIXME: We don't support run-ins with or as part of a continuation |
1991 // as it makes the back-and-forth placing complex. | 1999 // as it makes the back-and-forth placing complex. |
(...skipping 6277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8269 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor
yTypes::RenderingStructures); | 8277 memoryInstrumentation->addRootObject(gPositionedDescendantsMap, WebCoreMemor
yTypes::RenderingStructures); |
8270 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe
moryTypes::RenderingStructures); | 8278 memoryInstrumentation->addRootObject(gPercentHeightDescendantsMap, WebCoreMe
moryTypes::RenderingStructures); |
8271 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT
ypes::RenderingStructures); | 8279 memoryInstrumentation->addRootObject(gPositionedContainerMap, WebCoreMemoryT
ypes::RenderingStructures); |
8272 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo
ryTypes::RenderingStructures); | 8280 memoryInstrumentation->addRootObject(gPercentHeightContainerMap, WebCoreMemo
ryTypes::RenderingStructures); |
8273 memoryInstrumentation->addRootObject(gFloatingObjectContainerMap, WebCoreMem
oryTypes::RenderingStructures); | 8281 memoryInstrumentation->addRootObject(gFloatingObjectContainerMap, WebCoreMem
oryTypes::RenderingStructures); |
8274 memoryInstrumentation->addRootObject(gFloatingObjectMap, WebCoreMemoryTypes:
:RenderingStructures); | 8282 memoryInstrumentation->addRootObject(gFloatingObjectMap, WebCoreMemoryTypes:
:RenderingStructures); |
8275 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem
oryTypes::RenderingStructures); | 8283 memoryInstrumentation->addRootObject(gDelayedUpdateScrollInfoSet, WebCoreMem
oryTypes::RenderingStructures); |
8276 } | 8284 } |
8277 | 8285 |
8278 } // namespace WebCore | 8286 } // namespace WebCore |
OLD | NEW |