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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (object.hasCounterNodeMap()) { | 297 if (object.hasCounterNodeMap()) { |
298 if (CounterMap* nodeMap = counterMaps().get(&object)) { | 298 if (CounterMap* nodeMap = counterMaps().get(&object)) { |
299 if (CounterNode* node = nodeMap->get(identifier)) | 299 if (CounterNode* node = nodeMap->get(identifier)) |
300 return node; | 300 return node; |
301 } | 301 } |
302 } | 302 } |
303 | 303 |
304 bool isReset = false; | 304 bool isReset = false; |
305 int value = 0; | 305 int value = 0; |
306 if (!planCounter(object, identifier, isReset, value) && !alwaysCreateCounter
) | 306 if (!planCounter(object, identifier, isReset, value) && !alwaysCreateCounter
) |
307 return 0; | 307 return nullptr; |
308 | 308 |
309 RefPtr<CounterNode> newParent = nullptr; | 309 RefPtr<CounterNode> newParent = nullptr; |
310 RefPtr<CounterNode> newPreviousSibling = nullptr; | 310 RefPtr<CounterNode> newPreviousSibling = nullptr; |
311 RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value); | 311 RefPtr<CounterNode> newNode = CounterNode::create(object, isReset, value); |
312 if (findPlaceForCounter(object, identifier, isReset, newParent, newPreviousS
ibling)) | 312 if (findPlaceForCounter(object, identifier, isReset, newParent, newPreviousS
ibling)) |
313 newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifi
er); | 313 newParent->insertAfter(newNode.get(), newPreviousSibling.get(), identifi
er); |
314 CounterMap* nodeMap; | 314 CounterMap* nodeMap; |
315 if (object.hasCounterNodeMap()) { | 315 if (object.hasCounterNodeMap()) { |
316 nodeMap = counterMaps().get(&object); | 316 nodeMap = counterMaps().get(&object); |
317 } else { | 317 } else { |
(...skipping 22 matching lines...) Expand all Loading... |
340 if (stayWithin == parentElement(*currentLayoutObject) && currentCounter-
>hasResetType()) | 340 if (stayWithin == parentElement(*currentLayoutObject) && currentCounter-
>hasResetType()) |
341 break; | 341 break; |
342 newNode->insertAfter(currentCounter, newNode->lastChild(), identifier); | 342 newNode->insertAfter(currentCounter, newNode->lastChild(), identifier); |
343 } | 343 } |
344 return newNode.get(); | 344 return newNode.get(); |
345 } | 345 } |
346 | 346 |
347 LayoutCounter::LayoutCounter(Document* node, const CounterContent& counter) | 347 LayoutCounter::LayoutCounter(Document* node, const CounterContent& counter) |
348 : LayoutText(node, StringImpl::empty()) | 348 : LayoutText(node, StringImpl::empty()) |
349 , m_counter(counter) | 349 , m_counter(counter) |
350 , m_counterNode(0) | 350 , m_counterNode(nullptr) |
351 , m_nextForSameCounter(0) | 351 , m_nextForSameCounter(nullptr) |
352 { | 352 { |
353 view()->addLayoutCounter(); | 353 view()->addLayoutCounter(); |
354 } | 354 } |
355 | 355 |
356 LayoutCounter::~LayoutCounter() | 356 LayoutCounter::~LayoutCounter() |
357 { | 357 { |
358 } | 358 } |
359 | 359 |
360 void LayoutCounter::willBeDestroyed() | 360 void LayoutCounter::willBeDestroyed() |
361 { | 361 { |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 fprintf(stderr, " "); | 598 fprintf(stderr, " "); |
599 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", | 599 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", |
600 current, current->node(), current->parent(), current->previousSiblin
g(), | 600 current, current->node(), current->parent(), current->previousSiblin
g(), |
601 current->nextSibling(), current->hasCounterNodeMap() ? | 601 current->nextSibling(), current->hasCounterNodeMap() ? |
602 counterName ? blink::counterMaps().get(current)->get(identifier) : (
blink::CounterNode*)1 : (blink::CounterNode*)0); | 602 counterName ? blink::counterMaps().get(current)->get(identifier) : (
blink::CounterNode*)1 : (blink::CounterNode*)0); |
603 } | 603 } |
604 fflush(stderr); | 604 fflush(stderr); |
605 } | 605 } |
606 | 606 |
607 #endif // NDEBUG | 607 #endif // NDEBUG |
OLD | NEW |