| OLD | NEW |
| 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 RefPtr<CounterNode> newPreviousSibling = nullptr; | 385 RefPtr<CounterNode> newPreviousSibling = nullptr; |
| 386 RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value); | 386 RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value); |
| 387 if (findPlaceForCounter(object, identifier, isReset, newParent, | 387 if (findPlaceForCounter(object, identifier, isReset, newParent, |
| 388 newPreviousSibling)) | 388 newPreviousSibling)) |
| 389 newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifier); | 389 newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifier); |
| 390 CounterMap* nodeMap; | 390 CounterMap* nodeMap; |
| 391 if (object.hasCounterNodeMap()) { | 391 if (object.hasCounterNodeMap()) { |
| 392 nodeMap = counterMaps().get(&object); | 392 nodeMap = counterMaps().get(&object); |
| 393 } else { | 393 } else { |
| 394 nodeMap = new CounterMap; | 394 nodeMap = new CounterMap; |
| 395 counterMaps().set(&object, wrapUnique(nodeMap)); | 395 counterMaps().set(&object, WTF::wrapUnique(nodeMap)); |
| 396 object.setHasCounterNodeMap(true); | 396 object.setHasCounterNodeMap(true); |
| 397 } | 397 } |
| 398 nodeMap->set(identifier, newNode); | 398 nodeMap->set(identifier, newNode); |
| 399 if (newNode->parent()) | 399 if (newNode->parent()) |
| 400 return newNode.get(); | 400 return newNode.get(); |
| 401 // Checking if some nodes that were previously counter tree root nodes | 401 // Checking if some nodes that were previously counter tree root nodes |
| 402 // should become children of this node now. | 402 // should become children of this node now. |
| 403 CounterMaps& maps = counterMaps(); | 403 CounterMaps& maps = counterMaps(); |
| 404 Element* stayWithin = parentElement(object); | 404 Element* stayWithin = parentElement(object); |
| 405 bool skipDescendants; | 405 bool skipDescendants; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 current->parent(), current->previousSibling(), current->nextSibling(), | 705 current->parent(), current->previousSibling(), current->nextSibling(), |
| 706 current->hasCounterNodeMap() | 706 current->hasCounterNodeMap() |
| 707 ? counterName ? blink::counterMaps().get(current)->get(identifier) | 707 ? counterName ? blink::counterMaps().get(current)->get(identifier) |
| 708 : (blink::CounterNode*)1 | 708 : (blink::CounterNode*)1 |
| 709 : (blink::CounterNode*)0); | 709 : (blink::CounterNode*)0); |
| 710 } | 710 } |
| 711 fflush(stderr); | 711 fflush(stderr); |
| 712 } | 712 } |
| 713 | 713 |
| 714 #endif // NDEBUG | 714 #endif // NDEBUG |
| OLD | NEW |