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

Unified Diff: third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp

Issue 2017303002: Revert of Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp b/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
index ca41e143210a2c52ab59d4a965f4a1a4d8641f41..42c412bb66716df31b2f2b136c7abb286202b233 100644
--- a/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameSerializerImpl.cpp
@@ -149,7 +149,7 @@
result.append(WebFrameSerializer::generateMarkOfTheWebDeclaration(param->url));
} else if (isHTMLBaseElement(*element)) {
// Comment the BASE tag when serializing dom.
- result.append("<!--");
+ result.appendLiteral("<!--");
}
} else {
// Write XML declaration.
@@ -161,13 +161,13 @@
xmlEncoding = param->document->encodingName();
if (xmlEncoding.isEmpty())
xmlEncoding = UTF8Encoding().name();
- result.append("<?xml version=\"");
+ result.appendLiteral("<?xml version=\"");
result.append(param->document->xmlVersion());
- result.append("\" encoding=\"");
+ result.appendLiteral("\" encoding=\"");
result.append(xmlEncoding);
if (param->document->xmlStandalone())
- result.append("\" standalone=\"yes");
- result.append("\"?>\n");
+ result.appendLiteral("\" standalone=\"yes");
+ result.appendLiteral("\"?>\n");
}
// Add doc type declaration if original document has it.
if (!param->haveSeenDocType) {
@@ -237,7 +237,7 @@
return result.toString();
// Comment the BASE tag when serializing DOM.
if (isHTMLBaseElement(*element)) {
- result.append("-->");
+ result.appendLiteral("-->");
// Append a new base tag declaration.
result.append(WebFrameSerializer::generateBaseTagDeclaration(
param->document->baseTarget()));
@@ -284,7 +284,7 @@
const String& attrValue) {
result.append(' ');
result.append(attrName);
- result.append("=\"");
+ result.appendLiteral("=\"");
if (isHTMLDocument)
result.append(m_htmlEntities.convertEntitiesInString(attrValue));
else
@@ -381,7 +381,7 @@
return;
// Write end tag when element has child/children.
if (element->hasChildren() || param->haveAddedContentsBeforeEnd) {
- result.append("</");
+ result.appendLiteral("</");
result.append(element->nodeName().lower());
result.append('>');
} else {
@@ -391,13 +391,13 @@
// FIXME: This code is horribly wrong. WebFrameSerializerImpl must die.
if (!element->isHTMLElement() || !toHTMLElement(element)->ieForbidsInsertHTML()) {
// We need to write end tag when it is required.
- result.append("</");
+ result.appendLiteral("</");
result.append(element->nodeName().lower());
result.append('>');
}
} else {
// For xml base document.
- result.append(" />");
+ result.appendLiteral(" />");
}
}
// Do post action for end tag.
« no previous file with comments | « third_party/WebKit/Source/web/WebAXObject.cpp ('k') | third_party/WebKit/Source/web/tests/FrameSerializerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698