Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Side by Side Diff: Source/WebCore/rendering/RenderObject.cpp

Issue 9569043: Merge 109406 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2210 2210
2211 return o; 2211 return o;
2212 } 2212 }
2213 2213
2214 bool RenderObject::isSelectionBorder() const 2214 bool RenderObject::isSelectionBorder() const
2215 { 2215 {
2216 SelectionState st = selectionState(); 2216 SelectionState st = selectionState();
2217 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth; 2217 return st == SelectionStart || st == SelectionEnd || st == SelectionBoth;
2218 } 2218 }
2219 2219
2220 inline void RenderObject::clearLayoutRootIfNeeded() const
2221 {
2222 if (node() && !documentBeingDestroyed() && frame()) {
2223 if (FrameView* view = frame()->view()) {
2224 if (view->layoutRoot() == this) {
2225 ASSERT_NOT_REACHED();
2226 // This indicates a failure to layout the child, which is why
2227 // the layout root is still set to |this|. Make sure to clear it
2228 // since we are getting destroyed.
2229 view->clearLayoutRoot();
2230 }
2231 }
2232 }
2233 }
2234
2220 void RenderObject::willBeDestroyed() 2235 void RenderObject::willBeDestroyed()
2221 { 2236 {
2222 // Destroy any leftover anonymous children. 2237 // Destroy any leftover anonymous children.
2223 RenderObjectChildList* children = virtualChildren(); 2238 RenderObjectChildList* children = virtualChildren();
2224 if (children) 2239 if (children)
2225 children->destroyLeftoverChildren(); 2240 children->destroyLeftoverChildren();
2226 2241
2227 // If this renderer is being autoscrolled, stop the autoscroll timer 2242 // If this renderer is being autoscrolled, stop the autoscroll timer
2228 2243
2229 // FIXME: RenderObject::destroy should not get called with a renderer whose document 2244 // FIXME: RenderObject::destroy should not get called with a renderer whose document
(...skipping 18 matching lines...) Expand all
2248 2263
2249 if (m_hasCounterNodeMap) 2264 if (m_hasCounterNodeMap)
2250 RenderCounter::destroyCounterNodes(this); 2265 RenderCounter::destroyCounterNodes(this);
2251 2266
2252 // FIXME: Would like to do this in RenderBoxModelObject, but the timing is s o complicated that this can't easily 2267 // FIXME: Would like to do this in RenderBoxModelObject, but the timing is s o complicated that this can't easily
2253 // be moved into RenderBoxModelObject::destroy. 2268 // be moved into RenderBoxModelObject::destroy.
2254 if (hasLayer()) { 2269 if (hasLayer()) {
2255 setHasLayer(false); 2270 setHasLayer(false);
2256 toRenderBoxModelObject(this)->destroyLayer(); 2271 toRenderBoxModelObject(this)->destroyLayer();
2257 } 2272 }
2273
2274 clearLayoutRootIfNeeded();
2258 } 2275 }
2259 2276
2260 void RenderObject::destroy() 2277 void RenderObject::destroy()
2261 { 2278 {
2262 willBeDestroyed(); 2279 willBeDestroyed();
2263 arenaDelete(renderArena(), this); 2280 arenaDelete(renderArena(), this);
2264 } 2281 }
2265 2282
2266 void RenderObject::arenaDelete(RenderArena* arena, void* base) 2283 void RenderObject::arenaDelete(RenderArena* arena, void* base)
2267 { 2284 {
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
2828 { 2845 {
2829 if (object1) { 2846 if (object1) {
2830 const WebCore::RenderObject* root = object1; 2847 const WebCore::RenderObject* root = object1;
2831 while (root->parent()) 2848 while (root->parent())
2832 root = root->parent(); 2849 root = root->parent();
2833 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 2850 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
2834 } 2851 }
2835 } 2852 }
2836 2853
2837 #endif 2854 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698