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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index 04bfecc398e49c0c402a70089a50983906e22d16..629b64f72490b07bafb5ea768b48e14b3bf93398 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -1518,8 +1518,6 @@ String Node::debugNodeName() const
return nodeName();
}
-#ifndef NDEBUG
-
static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder, const QualifiedName& name, const char* attrDesc)
{
if (!node->isElementNode())
@@ -1535,6 +1533,28 @@ static void appendAttributeDesc(const Node* node, StringBuilder& stringBuilder,
stringBuilder.appendLiteral("\"");
}
+// |std::ostream| version of |Node::showNode|
+std::ostream& operator<<(std::ostream& ostream, const Node& node)
+{
+ ostream << node.nodeName();
+ if (node.isTextNode())
+ return ostream << " " << node.nodeValue();
+ StringBuilder attrs;
+ appendAttributeDesc(&node, attrs, HTMLNames::idAttr, " ID");
+ appendAttributeDesc(&node, attrs, HTMLNames::classAttr, " CLASS");
+ appendAttributeDesc(&node, attrs, HTMLNames::styleAttr, " STYLE");
+ return ostream << attrs.toString();
+}
+
+std::ostream& operator<<(std::ostream& ostream, const Node* node)
+{
+ if (!node)
+ return ostream << "null";
+ return ostream << *node;
+}
+
+#ifndef NDEBUG
+
void Node::showNode(const char* prefix) const
{
if (!prefix)
« 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