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

Side by Side Diff: third_party/WebKit/WebCore/rendering/RenderCounter.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 2 * Copyright (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. 3 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 271 }
272 272
273 static void destroyCounterNodeChildren(AtomicStringImpl* identifier, CounterNode * node) 273 static void destroyCounterNodeChildren(AtomicStringImpl* identifier, CounterNode * node)
274 { 274 {
275 CounterNode* previous; 275 CounterNode* previous;
276 for (CounterNode* child = lastDescendant(node); child && child != node; chil d = previous) { 276 for (CounterNode* child = lastDescendant(node); child && child != node; chil d = previous) {
277 previous = previousInPreOrder(child); 277 previous = previousInPreOrder(child);
278 child->parent()->removeChild(child); 278 child->parent()->removeChild(child);
279 ASSERT(counterMaps().get(child->renderer())->get(identifier) == child); 279 ASSERT(counterMaps().get(child->renderer())->get(identifier) == child);
280 counterMaps().get(child->renderer())->remove(identifier); 280 counterMaps().get(child->renderer())->remove(identifier);
281 child->renderer()->invalidateCounters(); 281 if (!child->renderer()->documentBeingDestroyed()) {
282 RenderObjectChildList* children = child->renderer()->virtualChildren ();
283 if (children)
284 children->invalidateCounters(child->renderer());
285 }
282 delete child; 286 delete child;
283 } 287 }
284 } 288 }
285 289
286 void RenderCounter::destroyCounterNodes(RenderObject* object) 290 void RenderCounter::destroyCounterNodes(RenderObject* object)
287 { 291 {
288 CounterMaps& maps = counterMaps(); 292 CounterMaps& maps = counterMaps();
289 CounterMap* map = maps.get(object); 293 CounterMap* map = maps.get(object);
290 if (!map) 294 if (!map)
291 return; 295 return;
292 maps.remove(object); 296 maps.remove(object);
293 297
294 CounterMap::const_iterator end = map->end(); 298 CounterMap::const_iterator end = map->end();
295 for (CounterMap::const_iterator it = map->begin(); it != end; ++it) { 299 for (CounterMap::const_iterator it = map->begin(); it != end; ++it) {
296 CounterNode* node = it->second; 300 CounterNode* node = it->second;
297 destroyCounterNodeChildren(it->first.get(), node); 301 destroyCounterNodeChildren(it->first.get(), node);
298 if (CounterNode* parent = node->parent()) 302 if (CounterNode* parent = node->parent())
299 parent->removeChild(node); 303 parent->removeChild(node);
300 delete node; 304 delete node;
301 } 305 }
302 306
303 delete map; 307 delete map;
304 } 308 }
305 309
306 } // namespace WebCore 310 } // namespace WebCore
307 311
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/rendering/RenderContainer.cpp ('k') | third_party/WebKit/WebCore/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698