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) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2207 | 2207 |
2208 return o; | 2208 return o; |
2209 } | 2209 } |
2210 | 2210 |
2211 bool RenderObject::isSelectionBorder() const | 2211 bool RenderObject::isSelectionBorder() const |
2212 { | 2212 { |
2213 SelectionState st = selectionState(); | 2213 SelectionState st = selectionState(); |
2214 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; | 2214 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; |
2215 } | 2215 } |
2216 | 2216 |
| 2217 inline void RenderObject::clearLayoutRootIfNeeded() const |
| 2218 { |
| 2219 if (node() && !documentBeingDestroyed() && frame()) { |
| 2220 if (FrameView* view = frame()->view()) { |
| 2221 if (view->layoutRoot() == this) { |
| 2222 ASSERT_NOT_REACHED(); |
| 2223 // This indicates a failure to layout the child, which is why |
| 2224 // the layout root is still set to |this|. Make sure to clear it |
| 2225 // since we are getting destroyed. |
| 2226 view->clearLayoutRoot(); |
| 2227 } |
| 2228 } |
| 2229 } |
| 2230 } |
| 2231 |
2217 void RenderObject::willBeDestroyed() | 2232 void RenderObject::willBeDestroyed() |
2218 { | 2233 { |
2219 // Destroy any leftover anonymous children. | 2234 // Destroy any leftover anonymous children. |
2220 RenderObjectChildList* children = virtualChildren(); | 2235 RenderObjectChildList* children = virtualChildren(); |
2221 if (children) | 2236 if (children) |
2222 children->destroyLeftoverChildren(); | 2237 children->destroyLeftoverChildren(); |
2223 | 2238 |
2224 // If this renderer is being autoscrolled, stop the autoscroll timer | 2239 // If this renderer is being autoscrolled, stop the autoscroll timer |
2225 | 2240 |
2226 // FIXME: RenderObject::destroy should not get called with a renderer whose
document | 2241 // FIXME: RenderObject::destroy should not get called with a renderer whose
document |
(...skipping 18 matching lines...) Expand all Loading... |
2245 | 2260 |
2246 if (hasCounterNodeMap()) | 2261 if (hasCounterNodeMap()) |
2247 RenderCounter::destroyCounterNodes(this); | 2262 RenderCounter::destroyCounterNodes(this); |
2248 | 2263 |
2249 // FIXME: Would like to do this in RenderBoxModelObject, but the timing is s
o complicated that this can't easily | 2264 // FIXME: Would like to do this in RenderBoxModelObject, but the timing is s
o complicated that this can't easily |
2250 // be moved into RenderBoxModelObject::destroy. | 2265 // be moved into RenderBoxModelObject::destroy. |
2251 if (hasLayer()) { | 2266 if (hasLayer()) { |
2252 setHasLayer(false); | 2267 setHasLayer(false); |
2253 toRenderBoxModelObject(this)->destroyLayer(); | 2268 toRenderBoxModelObject(this)->destroyLayer(); |
2254 } | 2269 } |
| 2270 |
| 2271 clearLayoutRootIfNeeded(); |
2255 } | 2272 } |
2256 | 2273 |
2257 void RenderObject::destroy() | 2274 void RenderObject::destroy() |
2258 { | 2275 { |
2259 willBeDestroyed(); | 2276 willBeDestroyed(); |
2260 arenaDelete(renderArena(), this); | 2277 arenaDelete(renderArena(), this); |
2261 } | 2278 } |
2262 | 2279 |
2263 void RenderObject::arenaDelete(RenderArena* arena, void* base) | 2280 void RenderObject::arenaDelete(RenderArena* arena, void* base) |
2264 { | 2281 { |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2827 { | 2844 { |
2828 if (object1) { | 2845 if (object1) { |
2829 const WebCore::RenderObject* root = object1; | 2846 const WebCore::RenderObject* root = object1; |
2830 while (root->parent()) | 2847 while (root->parent()) |
2831 root = root->parent(); | 2848 root = root->parent(); |
2832 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 2849 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
2833 } | 2850 } |
2834 } | 2851 } |
2835 | 2852 |
2836 #endif | 2853 #endif |
OLD | NEW |