diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp
index 68d332b76e8..0f27f07cf80 100644
--- a/mozilla/content/html/document/src/nsHTMLDocument.cpp
+++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp
@@ -2298,12 +2298,17 @@ nsHTMLDocument::WriteCommon(const nsAReadableString& aText,
mWriteLevel++;
- static const NS_NAMED_LITERAL_STRING(sNewLine, "\n");
-
- rv = mParser->Parse(aNewlineTerminate ? (aText + sNewLine) : aText,
- NS_GENERATE_PARSER_KEY(),
- NS_LITERAL_STRING("text/html"), PR_FALSE,
- (!mIsWriting || (mWriteLevel > 1)));
+ if (aNewlineTerminate) {
+ rv = mParser->Parse(aText + NS_LITERAL_STRING("\n"),
+ NS_GENERATE_PARSER_KEY(),
+ NS_LITERAL_STRING("text/html"), PR_FALSE,
+ (!mIsWriting || (mWriteLevel > 1)));
+ } else {
+ rv = mParser->Parse(aText,
+ NS_GENERATE_PARSER_KEY(),
+ NS_LITERAL_STRING("text/html"), PR_FALSE,
+ (!mIsWriting || (mWriteLevel > 1)));
+ }
mWriteLevel--;
return rv;