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

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

Issue 1845363003: String replaceWithLiteral should just use strlen, also rename to replace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another NUL fix. Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingStyle.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) 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 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1554 } 1554 }
1555 1555
1556 #ifndef NDEBUG 1556 #ifndef NDEBUG
1557 1557
1558 void Node::showNode(const char* prefix) const 1558 void Node::showNode(const char* prefix) const
1559 { 1559 {
1560 if (!prefix) 1560 if (!prefix)
1561 prefix = ""; 1561 prefix = "";
1562 if (isTextNode()) { 1562 if (isTextNode()) {
1563 String value = nodeValue(); 1563 String value = nodeValue();
1564 value.replaceWithLiteral('\\', "\\\\"); 1564 value.replace('\\', "\\\\");
1565 value.replaceWithLiteral('\n', "\\n"); 1565 value.replace('\n', "\\n");
1566 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());
1567 } else if (isDocumentTypeNode()) { 1567 } else if (isDocumentTypeNode()) {
1568 WTFLogAlways("%sDOCTYPE %s\t%p\n", prefix, nodeName().utf8().data(), thi s); 1568 WTFLogAlways("%sDOCTYPE %s\t%p\n", prefix, nodeName().utf8().data(), thi s);
1569 } else if (getNodeType() == PROCESSING_INSTRUCTION_NODE) { 1569 } else if (getNodeType() == PROCESSING_INSTRUCTION_NODE) {
1570 WTFLogAlways("%s?%s\t%p\n", prefix, nodeName().utf8().data(), this); 1570 WTFLogAlways("%s?%s\t%p\n", prefix, nodeName().utf8().data(), this);
1571 } else if (isShadowRoot()) { 1571 } else if (isShadowRoot()) {
1572 // nodeName of ShadowRoot is #document-fragment. It's confused with 1572 // nodeName of ShadowRoot is #document-fragment. It's confused with
1573 // DocumentFragment. 1573 // DocumentFragment.
1574 WTFLogAlways("%s#shadow-root\t%p\n", prefix, this); 1574 WTFLogAlways("%s#shadow-root\t%p\n", prefix, this);
1575 } else { 1575 } else {
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after
2449 2449
2450 void showNodePath(const blink::Node* node) 2450 void showNodePath(const blink::Node* node)
2451 { 2451 {
2452 if (node) 2452 if (node)
2453 node->showNodePathForThis(); 2453 node->showNodePathForThis();
2454 else 2454 else
2455 fprintf(stderr, "Cannot showNodePath for (nil)\n"); 2455 fprintf(stderr, "Cannot showNodePath for (nil)\n");
2456 } 2456 }
2457 2457
2458 #endif 2458 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/EditingStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698