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

Side by Side Diff: third_party/WebKit/Source/core/xml/parser/XMLErrors.cpp

Issue 2017053003: Remove StringBuilder::appendLiteral. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase. Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 m_lastErrorPosition = position; 74 m_lastErrorPosition = position;
75 ++m_errorCount; 75 ++m_errorCount;
76 } 76 }
77 } 77 }
78 78
79 void XMLErrors::appendErrorMessage(const String& typeString, TextPosition positi on, const char* message) 79 void XMLErrors::appendErrorMessage(const String& typeString, TextPosition positi on, const char* message)
80 { 80 {
81 // <typeString> on line <lineNumber> at column <columnNumber>: <message> 81 // <typeString> on line <lineNumber> at column <columnNumber>: <message>
82 m_errorMessages.append(typeString); 82 m_errorMessages.append(typeString);
83 m_errorMessages.appendLiteral(" on line "); 83 m_errorMessages.append(" on line ");
84 m_errorMessages.appendNumber(position.m_line.oneBasedInt()); 84 m_errorMessages.appendNumber(position.m_line.oneBasedInt());
85 m_errorMessages.appendLiteral(" at column "); 85 m_errorMessages.append(" at column ");
86 m_errorMessages.appendNumber(position.m_column.oneBasedInt()); 86 m_errorMessages.appendNumber(position.m_column.oneBasedInt());
87 m_errorMessages.appendLiteral(": "); 87 m_errorMessages.append(": ");
88 m_errorMessages.append(message); 88 m_errorMessages.append(message);
89 } 89 }
90 90
91 static inline Element* createXHTMLParserErrorHeader(Document* doc, const String& errorMessages) 91 static inline Element* createXHTMLParserErrorHeader(Document* doc, const String& errorMessages)
92 { 92 {
93 Element* reportElement = doc->createElement(QualifiedName(nullAtom, "parsere rror", xhtmlNamespaceURI), CreatedByParser); 93 Element* reportElement = doc->createElement(QualifiedName(nullAtom, "parsere rror", xhtmlNamespaceURI), CreatedByParser);
94 94
95 Vector<Attribute> reportAttributes; 95 Vector<Attribute> reportAttributes;
96 reportAttributes.append(Attribute(styleAttr, "display: block; white-space: p re; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black")); 96 reportAttributes.append(Attribute(styleAttr, "display: block; white-space: p re; border: 2px solid #c77; padding: 0 1em 0 1em; margin: 1em; background-color: #fdd; color: black"));
97 reportElement->parserSetAttributes(reportAttributes); 97 reportElement->parserSetAttributes(reportAttributes);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 if (firstChild) 164 if (firstChild)
165 documentElement->parserInsertBefore(reportElement, *firstChild); 165 documentElement->parserInsertBefore(reportElement, *firstChild);
166 else 166 else
167 documentElement->parserAppendChild(reportElement); 167 documentElement->parserAppendChild(reportElement);
168 168
169 // FIXME: Why do we need to call this manually? 169 // FIXME: Why do we need to call this manually?
170 m_document->updateStyleAndLayoutTree(); 170 m_document->updateStyleAndLayoutTree();
171 } 171 }
172 172
173 } // namespace blink 173 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698