diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebCore/dom/XMLDocumentParser.cpp | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebCore/dom/XMLDocumentParser.cpp')
-rw-r--r-- | WebCore/dom/XMLDocumentParser.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/WebCore/dom/XMLDocumentParser.cpp b/WebCore/dom/XMLDocumentParser.cpp index 4ae18a1..b790217 100644 --- a/WebCore/dom/XMLDocumentParser.cpp +++ b/WebCore/dom/XMLDocumentParser.cpp @@ -51,7 +51,7 @@ #include "ScriptValue.h" #include "TextResourceDecoder.h" #include "TreeDepthLimit.h" -#include <wtf/text/CString.h> +#include <wtf/text/StringConcatenate.h> #include <wtf/StringExtras.h> #include <wtf/Threading.h> #include <wtf/Vector.h> @@ -151,11 +151,11 @@ void XMLDocumentParser::handleError(ErrorType type, const char* m, int lineNumbe if (type == fatal || (m_errorCount < maxErrors && m_lastErrorLine != lineNumber && m_lastErrorColumn != columnNumber)) { switch (type) { case warning: - m_errorMessages += String::format("warning on line %d at column %d: %s", lineNumber, columnNumber, m); + m_errorMessages += makeString("warning on line ", String::number(lineNumber), " at column ", String::number(columnNumber), ": ", m); break; case fatal: case nonFatal: - m_errorMessages += String::format("error on line %d at column %d: %s", lineNumber, columnNumber, m); + m_errorMessages += makeString("error on line ", String::number(lineNumber), " at column ", String::number(columnNumber), ": ", m); } m_lastErrorLine = lineNumber; @@ -293,47 +293,47 @@ void XMLDocumentParser::insertErrorMessageBlock() // Create elements for display ExceptionCode ec = 0; - Document* doc = document(); - Node* documentElement = doc->documentElement(); + Document* document = this->document(); + Element* documentElement = document->documentElement(); if (!documentElement) { - RefPtr<Node> rootElement = doc->createElement(htmlTag, false); - doc->appendChild(rootElement, ec); - RefPtr<Node> body = doc->createElement(bodyTag, false); + RefPtr<Element> rootElement = document->createElement(htmlTag, false); + document->appendChild(rootElement, ec); + RefPtr<Element> body = document->createElement(bodyTag, false); rootElement->appendChild(body, ec); documentElement = body.get(); } #if ENABLE(SVG) else if (documentElement->namespaceURI() == SVGNames::svgNamespaceURI) { - RefPtr<Node> rootElement = doc->createElement(htmlTag, false); - RefPtr<Node> body = doc->createElement(bodyTag, false); + RefPtr<Element> rootElement = document->createElement(htmlTag, false); + RefPtr<Element> body = document->createElement(bodyTag, false); rootElement->appendChild(body, ec); body->appendChild(documentElement, ec); - doc->appendChild(rootElement.get(), ec); + document->appendChild(rootElement.get(), ec); documentElement = body.get(); } #endif #if ENABLE(WML) else if (isWMLDocument()) { - RefPtr<Node> rootElement = doc->createElement(htmlTag, false); - RefPtr<Node> body = doc->createElement(bodyTag, false); + RefPtr<Element> rootElement = document->createElement(htmlTag, false); + RefPtr<Element> body = document->createElement(bodyTag, false); rootElement->appendChild(body, ec); body->appendChild(documentElement, ec); - doc->appendChild(rootElement.get(), ec); + document->appendChild(rootElement.get(), ec); documentElement = body.get(); } #endif - RefPtr<Element> reportElement = createXHTMLParserErrorHeader(doc, m_errorMessages); + RefPtr<Element> reportElement = createXHTMLParserErrorHeader(document, m_errorMessages); documentElement->insertBefore(reportElement, documentElement->firstChild(), ec); #if ENABLE(XSLT) - if (doc->transformSourceDocument()) { - RefPtr<Element> par = doc->createElement(pTag, false); - reportElement->appendChild(par, ec); - par->setAttribute(styleAttr, "white-space: normal"); - par->appendChild(doc->createTextNode("This document was created as the result of an XSL transformation. The line and column numbers given are from the transformed result."), ec); + if (document->transformSourceDocument()) { + RefPtr<Element> paragraph = document->createElement(pTag, false); + paragraph->setAttribute(styleAttr, "white-space: normal"); + paragraph->appendChild(document->createTextNode("This document was created as the result of an XSL transformation. The line and column numbers given are from the transformed result."), ec); + reportElement->appendChild(paragraph.release(), ec); } #endif - doc->updateStyleIfNeeded(); + document->updateStyleIfNeeded(); } void XMLDocumentParser::notifyFinished(CachedResource* unusedResource) |