| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 Element* self = toElement(object.node()); | 96 Element* self = toElement(object.node()); |
| 97 ASSERT(self); | 97 ASSERT(self); |
| 98 Element* next = skipDescendants ? ElementTraversal::nextIncludingPseudoSkipp
ingChildren(*self, stayWithin) : ElementTraversal::nextIncludingPseudo(*self, st
ayWithin); | 98 Element* next = skipDescendants ? ElementTraversal::nextIncludingPseudoSkipp
ingChildren(*self, stayWithin) : ElementTraversal::nextIncludingPseudo(*self, st
ayWithin); |
| 99 while (next && !next->layoutObject()) | 99 while (next && !next->layoutObject()) |
| 100 next = skipDescendants ? ElementTraversal::nextIncludingPseudoSkippingCh
ildren(*next, stayWithin) : ElementTraversal::nextIncludingPseudo(*next, stayWit
hin); | 100 next = skipDescendants ? ElementTraversal::nextIncludingPseudoSkippingCh
ildren(*next, stayWithin) : ElementTraversal::nextIncludingPseudo(*next, stayWit
hin); |
| 101 return next ? next->layoutObject() : 0; | 101 return next ? next->layoutObject() : 0; |
| 102 } | 102 } |
| 103 | 103 |
| 104 static bool planCounter(LayoutObject& object, const AtomicString& identifier, bo
ol& isReset, int& value) | 104 static bool planCounter(LayoutObject& object, const AtomicString& identifier, bo
ol& isReset, int& value) |
| 105 { | 105 { |
| 106 // Real text nodes don't have their own style so they can't have counters. | |
| 107 // We can't even look at their styles or we'll see extra resets and incremen
ts! | |
| 108 if (object.isText() && !object.isBR()) | |
| 109 return false; | |
| 110 Node* generatingNode = object.generatingNode(); | 106 Node* generatingNode = object.generatingNode(); |
| 111 // We must have a generating node or else we cannot have a counter. | 107 // We must have a generating node or else we cannot have a counter. |
| 112 if (!generatingNode) | 108 if (!generatingNode) |
| 113 return false; | 109 return false; |
| 114 const ComputedStyle& style = object.styleRef(); | 110 const ComputedStyle& style = object.styleRef(); |
| 115 | 111 |
| 116 switch (style.styleType()) { | 112 switch (style.styleType()) { |
| 117 case NOPSEUDO: | 113 case NOPSEUDO: |
| 118 // Sometimes nodes have more then one layoutObject. Only the first one g
ets the counter | 114 // Sometimes nodes have more then one layoutObject. Only the first one g
ets the counter |
| 119 // LayoutTests/http/tests/css/counter-crash.html | 115 // LayoutTests/http/tests/css/counter-crash.html |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 fprintf(stderr, " "); | 594 fprintf(stderr, " "); |
| 599 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", | 595 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", |
| 600 current, current->node(), current->parent(), current->previousSiblin
g(), | 596 current, current->node(), current->parent(), current->previousSiblin
g(), |
| 601 current->nextSibling(), current->hasCounterNodeMap() ? | 597 current->nextSibling(), current->hasCounterNodeMap() ? |
| 602 counterName ? blink::counterMaps().get(current)->get(identifier) : (
blink::CounterNode*)1 : (blink::CounterNode*)0); | 598 counterName ? blink::counterMaps().get(current)->get(identifier) : (
blink::CounterNode*)1 : (blink::CounterNode*)0); |
| 603 } | 599 } |
| 604 fflush(stderr); | 600 fflush(stderr); |
| 605 } | 601 } |
| 606 | 602 |
| 607 #endif // NDEBUG | 603 #endif // NDEBUG |
| OLD | NEW |