Fix the HTML serializer to not do fancy linebreaking when "raw" output is

requested.  Use this in innerHTML.  Bug 89780, r+sr=peterv


git-svn-id: svn://10.0.0.236/trunk@168919 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-02-07 17:24:05 +00:00
parent 3868653c76
commit 83d378bf95
3 changed files with 22 additions and 8 deletions

View File

@@ -189,6 +189,12 @@ nsHTMLContentSerializer::AppendText(nsIDOMText* aText,
if (mPreLevel > 0) {
AppendToStringConvertLF(data, aStr);
}
else if (mFlags & nsIDocumentEncoder::OutputRaw) {
PRInt32 lastNewlineOffset = data.RFindChar('\n');
AppendToString(data, aStr);
if (lastNewlineOffset != kNotFound)
mColPos = data.Length() - lastNewlineOffset;
}
else if (!mDoFormat) {
PRInt32 lastNewlineOffset = kNotFound;
PRBool hasLongLines = HasLongLines(data, lastNewlineOffset);
@@ -202,12 +208,6 @@ nsHTMLContentSerializer::AppendText(nsIDOMText* aText,
AppendToStringConvertLF(data, aStr);
}
}
else if (mFlags & nsIDocumentEncoder::OutputRaw) {
PRInt32 lastNewlineOffset = data.RFindChar('\n');
AppendToString(data, aStr);
if (lastNewlineOffset != kNotFound)
mColPos = data.Length() - lastNewlineOffset;
}
else {
AppendToStringWrapped(data, aStr, PR_FALSE);
}