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

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

Issue 1828163002: Remove ASSERT_ARG(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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
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 1500 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 } 1511 }
1512 } 1512 }
1513 return name.toString(); 1513 return name.toString();
1514 } 1514 }
1515 1515
1516 String Node::debugNodeName() const 1516 String Node::debugNodeName() const
1517 { 1517 {
1518 return nodeName(); 1518 return nodeName();
1519 } 1519 }
1520 1520
1521 #ifndef NDEBUG
1522
1523 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc) 1521 static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc)
1524 { 1522 {
1525 if (!node->isElementNode()) 1523 if (!node->isElementNode())
1526 return; 1524 return;
1527 1525
1528 String attr = toElement(node)->getAttribute(name); 1526 String attr = toElement(node)->getAttribute(name);
1529 if (attr.isEmpty()) 1527 if (attr.isEmpty())
1530 return; 1528 return;
1531 1529
1532 stringBuilder.append(attrDesc); 1530 stringBuilder.append(attrDesc);
1533 stringBuilder.appendLiteral("=\""); 1531 stringBuilder.appendLiteral("=\"");
1534 stringBuilder.append(attr); 1532 stringBuilder.append(attr);
1535 stringBuilder.appendLiteral("\""); 1533 stringBuilder.appendLiteral("\"");
1536 } 1534 }
1537 1535
1536 // |std::ostream| version of |Node::showNode|
1537 std::ostream& operator<<(std::ostream& ostream, const Node& node)
1538 {
1539 ostream << node.nodeName();
1540 if (node.isTextNode())
1541 return ostream << " " << node.nodeValue();
1542 StringBuilder attrs;
1543 appendAttributeDesc(&node, attrs, HTMLNames::idAttr, " ID");
1544 appendAttributeDesc(&node, attrs, HTMLNames::classAttr, " CLASS");
1545 appendAttributeDesc(&node, attrs, HTMLNames::styleAttr, " STYLE");
1546 return ostream << attrs.toString();
1547 }
1548
1549 std::ostream& operator<<(std::ostream& ostream, const Node* node)
1550 {
1551 if (!node)
1552 return ostream << "null";
1553 return ostream << *node;
1554 }
1555
1556 #ifndef NDEBUG
1557
1538 void Node::showNode(const char* prefix) const 1558 void Node::showNode(const char* prefix) const
1539 { 1559 {
1540 if (!prefix) 1560 if (!prefix)
1541 prefix = ""; 1561 prefix = "";
1542 if (isTextNode()) { 1562 if (isTextNode()) {
1543 String value = nodeValue(); 1563 String value = nodeValue();
1544 value.replaceWithLiteral('\\', "\\\\"); 1564 value.replaceWithLiteral('\\', "\\\\");
1545 value.replaceWithLiteral('\n', "\\n"); 1565 value.replaceWithLiteral('\n', "\\n");
1546 WTFLogAlways("%s%s\t%p \"%s\"\n", prefix, nodeName().utf8().data(), this , value.utf8().data()); 1566 WTFLogAlways("%s%s\t%p \"%s\"\n", prefix, nodeName().utf8().data(), this , value.utf8().data());
1547 } else if (isDocumentTypeNode()) { 1567 } else if (isDocumentTypeNode()) {
(...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 2449
2430 void showNodePath(const blink::Node* node) 2450 void showNodePath(const blink::Node* node)
2431 { 2451 {
2432 if (node) 2452 if (node)
2433 node->showNodePathForThis(); 2453 node->showNodePathForThis();
2434 else 2454 else
2435 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2455 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2436 } 2456 }
2437 2457
2438 #endif 2458 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.h ('k') | third_party/WebKit/Source/core/editing/Position.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698