Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Side by Side Diff: Source/core/rendering/RenderCounter.cpp

Issue 24773003: Rename Node::attached() to confusingAndOftenMisusedAttached() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/Frame.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 void RenderCounter::rendererSubtreeAttached(RenderObject* renderer) 535 void RenderCounter::rendererSubtreeAttached(RenderObject* renderer)
536 { 536 {
537 ASSERT(renderer->view()); 537 ASSERT(renderer->view());
538 if (!renderer->view()->hasRenderCounters()) 538 if (!renderer->view()->hasRenderCounters())
539 return; 539 return;
540 Node* node = renderer->node(); 540 Node* node = renderer->node();
541 if (node) 541 if (node)
542 node = node->parentNode(); 542 node = node->parentNode();
543 else 543 else
544 node = renderer->generatingNode(); 544 node = renderer->generatingNode();
545 if (node && !node->attached()) 545 if (node && !node->confusingAndOftenMisusedAttached())
546 return; // No need to update if the parent is not attached yet 546 return; // No need to update if the parent is not attached yet
547 for (RenderObject* descendant = renderer; descendant; descendant = descendan t->nextInPreOrder(renderer)) 547 for (RenderObject* descendant = renderer; descendant; descendant = descendan t->nextInPreOrder(renderer))
548 updateCounters(descendant); 548 updateCounters(descendant);
549 } 549 }
550 550
551 void RenderCounter::rendererStyleChanged(RenderObject* renderer, const RenderSty le* oldStyle, const RenderStyle* newStyle) 551 void RenderCounter::rendererStyleChanged(RenderObject* renderer, const RenderSty le* oldStyle, const RenderStyle* newStyle)
552 { 552 {
553 Node* node = renderer->generatingNode(); 553 Node* node = renderer->generatingNode();
554 if (!node || !node->attached()) 554 if (!node || !node->confusingAndOftenMisusedAttached())
555 return; // cannot have generated content or if it can have, it will be h andled during attaching 555 return; // cannot have generated content or if it can have, it will be h andled during attaching
556 const CounterDirectiveMap* newCounterDirectives; 556 const CounterDirectiveMap* newCounterDirectives;
557 const CounterDirectiveMap* oldCounterDirectives; 557 const CounterDirectiveMap* oldCounterDirectives;
558 if (oldStyle && (oldCounterDirectives = oldStyle->counterDirectives())) { 558 if (oldStyle && (oldCounterDirectives = oldStyle->counterDirectives())) {
559 if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) { 559 if (newStyle && (newCounterDirectives = newStyle->counterDirectives())) {
560 CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives ->end(); 560 CounterDirectiveMap::const_iterator newMapEnd = newCounterDirectives ->end();
561 CounterDirectiveMap::const_iterator oldMapEnd = oldCounterDirectives ->end(); 561 CounterDirectiveMap::const_iterator oldMapEnd = oldCounterDirectives ->end();
562 for (CounterDirectiveMap::const_iterator it = newCounterDirectives-> begin(); it != newMapEnd; ++it) { 562 for (CounterDirectiveMap::const_iterator it = newCounterDirectives-> begin(); it != newMapEnd; ++it) {
563 CounterDirectiveMap::const_iterator oldMapIt = oldCounterDirecti ves->find(it->key); 563 CounterDirectiveMap::const_iterator oldMapIt = oldCounterDirecti ves->find(it->key);
564 if (oldMapIt != oldMapEnd) { 564 if (oldMapIt != oldMapEnd) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 fprintf(stderr, " "); 610 fprintf(stderr, " ");
611 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n", 611 fprintf(stderr, "%p N:%p P:%p PS:%p NS:%p C:%p\n",
612 current, current->node(), current->parent(), current->previousSiblin g(), 612 current, current->node(), current->parent(), current->previousSiblin g(),
613 current->nextSibling(), current->hasCounterNodeMap() ? 613 current->nextSibling(), current->hasCounterNodeMap() ?
614 counterName ? WebCore::counterMaps().get(current)->get(identifier) : (WebCore::CounterNode*)1 : (WebCore::CounterNode*)0); 614 counterName ? WebCore::counterMaps().get(current)->get(identifier) : (WebCore::CounterNode*)1 : (WebCore::CounterNode*)0);
615 } 615 }
616 fflush(stderr); 616 fflush(stderr);
617 } 617 }
618 618
619 #endif // NDEBUG 619 #endif // NDEBUG
OLDNEW
« no previous file with comments | « Source/core/page/Frame.cpp ('k') | Source/core/rendering/RenderMenuList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698