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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 1158433004: Remove Attr child nodes (making Attr a Node, not a ContainerNode) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: address feedback Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 { 511 {
512 updateDistribution(); 512 updateDistribution();
513 513
514 // Go through the subtree beneath us, normalizing all nodes. This means that 514 // Go through the subtree beneath us, normalizing all nodes. This means that
515 // any two adjacent text nodes are merged and any empty text nodes are remov ed. 515 // any two adjacent text nodes are merged and any empty text nodes are remov ed.
516 516
517 RefPtrWillBeRawPtr<Node> node = this; 517 RefPtrWillBeRawPtr<Node> node = this;
518 while (Node* firstChild = node->firstChild()) 518 while (Node* firstChild = node->firstChild())
519 node = firstChild; 519 node = firstChild;
520 while (node) { 520 while (node) {
521 if (node->isElementNode())
522 toElement(node)->normalizeAttributes();
523
524 if (node == this) 521 if (node == this)
525 break; 522 break;
526 523
527 if (node->nodeType() == TEXT_NODE) 524 if (node->nodeType() == TEXT_NODE)
528 node = toText(node)->mergeNextSiblingNodesIfPossible(); 525 node = toText(node)->mergeNextSiblingNodesIfPossible();
529 else 526 else
530 node = NodeTraversal::nextPostOrder(*node); 527 node = NodeTraversal::nextPostOrder(*node);
531 } 528 }
532 } 529 }
533 530
(...skipping 1971 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 2502
2506 void showNodePath(const blink::Node* node) 2503 void showNodePath(const blink::Node* node)
2507 { 2504 {
2508 if (node) 2505 if (node)
2509 node->showNodePathForThis(); 2506 node->showNodePathForThis();
2510 else 2507 else
2511 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2508 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2512 } 2509 }
2513 2510
2514 #endif 2511 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698