| 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 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 | 607 |
| 608 void LayoutCounter::layoutObjectSubtreeAttached(LayoutObject* layoutObject) { | 608 void LayoutCounter::layoutObjectSubtreeAttached(LayoutObject* layoutObject) { |
| 609 ASSERT(layoutObject->view()); | 609 ASSERT(layoutObject->view()); |
| 610 if (!layoutObject->view()->hasLayoutCounters()) | 610 if (!layoutObject->view()->hasLayoutCounters()) |
| 611 return; | 611 return; |
| 612 Node* node = layoutObject->node(); | 612 Node* node = layoutObject->node(); |
| 613 if (node) | 613 if (node) |
| 614 node = node->parentNode(); | 614 node = node->parentNode(); |
| 615 else | 615 else |
| 616 node = layoutObject->generatingNode(); | 616 node = layoutObject->generatingNode(); |
| 617 if (node && node->needsAttach()) | 617 if (node && node->needsReattachLayoutTree()) |
| 618 return; // No need to update if the parent is not attached yet | 618 return; // No need to update if the parent is not attached yet |
| 619 for (LayoutObject* descendant = layoutObject; descendant; | 619 for (LayoutObject* descendant = layoutObject; descendant; |
| 620 descendant = descendant->nextInPreOrder(layoutObject)) | 620 descendant = descendant->nextInPreOrder(layoutObject)) |
| 621 updateCounters(*descendant); | 621 updateCounters(*descendant); |
| 622 } | 622 } |
| 623 | 623 |
| 624 void LayoutCounter::layoutObjectStyleChanged(LayoutObject& layoutObject, | 624 void LayoutCounter::layoutObjectStyleChanged(LayoutObject& layoutObject, |
| 625 const ComputedStyle* oldStyle, | 625 const ComputedStyle* oldStyle, |
| 626 const ComputedStyle& newStyle) { | 626 const ComputedStyle& newStyle) { |
| 627 Node* node = layoutObject.generatingNode(); | 627 Node* node = layoutObject.generatingNode(); |
| 628 if (!node || node->needsAttach()) | 628 if (!node || node->needsReattachLayoutTree()) |
| 629 return; // cannot have generated content or if it can have, it will be | 629 return; // cannot have generated content or if it can have, it will be |
| 630 // handled during attaching | 630 // handled during attaching |
| 631 const CounterDirectiveMap* oldCounterDirectives = | 631 const CounterDirectiveMap* oldCounterDirectives = |
| 632 oldStyle ? oldStyle->counterDirectives() : 0; | 632 oldStyle ? oldStyle->counterDirectives() : 0; |
| 633 const CounterDirectiveMap* newCounterDirectives = | 633 const CounterDirectiveMap* newCounterDirectives = |
| 634 newStyle.counterDirectives(); | 634 newStyle.counterDirectives(); |
| 635 if (oldCounterDirectives) { | 635 if (oldCounterDirectives) { |
| 636 if (newCounterDirectives) { | 636 if (newCounterDirectives) { |
| 637 CounterDirectiveMap::const_iterator newMapEnd = | 637 CounterDirectiveMap::const_iterator newMapEnd = |
| 638 newCounterDirectives->end(); | 638 newCounterDirectives->end(); |
| (...skipping 66 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 |