OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 2 * Copyright (C) 2005 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 12 matching lines...) Expand all Loading... |
23 #include "core/rendering/CounterNode.h" | 23 #include "core/rendering/CounterNode.h" |
24 | 24 |
25 #include "core/rendering/RenderCounter.h" | 25 #include "core/rendering/RenderCounter.h" |
26 | 26 |
27 #ifndef NDEBUG | 27 #ifndef NDEBUG |
28 #include <stdio.h> | 28 #include <stdio.h> |
29 #endif | 29 #endif |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 CounterNode::CounterNode(RenderObject* o, bool hasResetType, int value) | 33 CounterNode::CounterNode(RenderObject& o, bool hasResetType, int value) |
34 : m_hasResetType(hasResetType) | 34 : m_hasResetType(hasResetType) |
35 , m_value(value) | 35 , m_value(value) |
36 , m_countInParent(0) | 36 , m_countInParent(0) |
37 , m_owner(o) | 37 , m_owner(o) |
38 , m_rootRenderer(0) | 38 , m_rootRenderer(0) |
39 , m_parent(0) | 39 , m_parent(0) |
40 , m_previousSibling(0) | 40 , m_previousSibling(0) |
41 , m_nextSibling(0) | 41 , m_nextSibling(0) |
42 , m_firstChild(0) | 42 , m_firstChild(0) |
43 , m_lastChild(0) | 43 , m_lastChild(0) |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 nextSibling->m_previousSibling = child; | 85 nextSibling->m_previousSibling = child; |
86 oldPreviousSibling = child; | 86 oldPreviousSibling = child; |
87 } | 87 } |
88 child = nextChild; | 88 child = nextChild; |
89 } | 89 } |
90 } | 90 } |
91 } | 91 } |
92 resetRenderers(); | 92 resetRenderers(); |
93 } | 93 } |
94 | 94 |
95 PassRefPtr<CounterNode> CounterNode::create(RenderObject* owner, bool hasResetTy
pe, int value) | 95 PassRefPtr<CounterNode> CounterNode::create(RenderObject& owner, bool hasResetTy
pe, int value) |
96 { | 96 { |
97 return adoptRef(new CounterNode(owner, hasResetType, value)); | 97 return adoptRef(new CounterNode(owner, hasResetType, value)); |
98 } | 98 } |
99 | 99 |
100 CounterNode* CounterNode::nextInPreOrderAfterChildren(const CounterNode* stayWit
hin) const | 100 CounterNode* CounterNode::nextInPreOrderAfterChildren(const CounterNode* stayWit
hin) const |
101 { | 101 { |
102 if (this == stayWithin) | 102 if (this == stayWithin) |
103 return 0; | 103 return 0; |
104 | 104 |
105 const CounterNode* current = this; | 105 const CounterNode* current = this; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 while (root->parent()) | 360 while (root->parent()) |
361 root = root->parent(); | 361 root = root->parent(); |
362 | 362 |
363 for (const CounterNode* current = root; current; current = current->nextInPr
eOrder()) { | 363 for (const CounterNode* current = root; current; current = current->nextInPr
eOrder()) { |
364 fprintf(stderr, "%c", (current == node) ? '*' : ' '); | 364 fprintf(stderr, "%c", (current == node) ? '*' : ' '); |
365 for (const CounterNode* parent = current; parent && parent != root; pare
nt = parent->parent()) | 365 for (const CounterNode* parent = current; parent && parent != root; pare
nt = parent->parent()) |
366 fprintf(stderr, " "); | 366 fprintf(stderr, " "); |
367 fprintf(stderr, "%p %s: %d %d P:%p PS:%p NS:%p R:%p\n", | 367 fprintf(stderr, "%p %s: %d %d P:%p PS:%p NS:%p R:%p\n", |
368 current, current->actsAsReset() ? "reset____" : "increment", current
->value(), | 368 current, current->actsAsReset() ? "reset____" : "increment", current
->value(), |
369 current->countInParent(), current->parent(), current->previousSiblin
g(), | 369 current->countInParent(), current->parent(), current->previousSiblin
g(), |
370 current->nextSibling(), current->owner()); | 370 current->nextSibling(), ¤t->owner()); |
371 } | 371 } |
372 fflush(stderr); | 372 fflush(stderr); |
373 } | 373 } |
374 | 374 |
375 #endif | 375 #endif |
376 | 376 |
377 } // namespace WebCore | 377 } // namespace WebCore |
378 | 378 |
379 #ifndef NDEBUG | 379 #ifndef NDEBUG |
380 | 380 |
381 void showCounterTree(const WebCore::CounterNode* counter) | 381 void showCounterTree(const WebCore::CounterNode* counter) |
382 { | 382 { |
383 if (counter) | 383 if (counter) |
384 showTreeAndMark(counter); | 384 showTreeAndMark(counter); |
385 } | 385 } |
386 | 386 |
387 #endif | 387 #endif |
OLD | NEW |