diff --git a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp index 30582bf51a9..de98bc9b5c5 100644 --- a/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp +++ b/mozilla/htmlparser/src/nsHTMLToTXTSinkStream.cpp @@ -472,8 +472,8 @@ PRBool nsHTMLToTXTSinkStream::IsConverted(const nsIParserNode& aNode) NS_SUCCEEDED(rv) && ( - value.EqualsWithConversion("txt", PR_TRUE, 3) || - value.EqualsWithConversion("\"txt", PR_TRUE, 4) + value.EqualsWithConversion("moz-txt", PR_TRUE, 7) || + value.EqualsWithConversion("\"moz-txt", PR_TRUE, 8) ) ); } @@ -908,8 +908,8 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode) } else if (type == eHTMLTag_text) { - /* Check, if some other MUA (e.g. 4.x) recognized the URL in - plain text and inserted an element. If yes, output only once. */ + /* Check, if some other MUA (e.g. 4.x) recognized the URI in + plain text and inserted an element. If yes, output URI only once. */ if (!mURL.IsEmpty() && mURL == text) mURL.Truncate(); if ( @@ -1797,4 +1797,3 @@ PRInt32 unicharwidth(const PRUnichar* pwcs, PRInt32 n) return width; } - diff --git a/mozilla/mailnews/mime/src/mimethtm.cpp b/mozilla/mailnews/mime/src/mimethtm.cpp index b655fc67cf1..a1a95b58acf 100644 --- a/mozilla/mailnews/mime/src/mimethtm.cpp +++ b/mozilla/mailnews/mime/src/mimethtm.cpp @@ -65,12 +65,12 @@ MimeInlineTextHTML_parse_begin (MimeObject *obj) PRInt32 fontSize; // default font size if (NS_SUCCEEDED(GetMailNewsFont(obj, PR_FALSE, fontName, sizeof(fontName), &fontSize))) { - PR_snprintf(buf, 256, "
", (const char *) fontName, fontSize); + PR_snprintf(buf, 256, "
", (const char *) fontName, fontSize); status = MimeObject_write(obj, buf, nsCRT::strlen(buf), PR_FALSE); } else { - status = MimeObject_write(obj, "
", 5, PR_FALSE); + status = MimeObject_write(obj, "
", 27, PR_FALSE); } if(status<0) return status; } diff --git a/mozilla/mailnews/mime/src/mimetpfl.cpp b/mozilla/mailnews/mime/src/mimetpfl.cpp index 170db87b700..65423fe69df 100644 --- a/mozilla/mailnews/mime/src/mimetpfl.cpp +++ b/mozilla/mailnews/mime/src/mimetpfl.cpp @@ -168,7 +168,7 @@ MimeInlineTextPlainFlowed_parse_begin (MimeObject *obj) /* 4.x' editor can't break
s (e.g. to interleave comments). We'll add the class to the
later. */ { - nsCAutoString openingDiv("
isSig && !quoting) { - status = MimeObject_write(obj, "
", 6, PR_FALSE); // txt-sig + status = MimeObject_write(obj, "
", 6, PR_FALSE); // .moz-txt-sig if (status<0) goto EarlyOut; } if (!quoting) // HACK (see above) { - status = MimeObject_write(obj, "
", 6, PR_FALSE); // text-flowed + status = MimeObject_write(obj, "
", 6, PR_FALSE); // .moz-text-flowed if (status<0) goto EarlyOut; } @@ -406,8 +406,8 @@ MimeInlineTextPlainFlowed_parse_line (char *line, PRInt32 length, MimeObject *ob preface += "-- 
"; } else { exdata->isSig = PR_TRUE; - preface += - "
-- 
"; + preface += "
" + "-- 
"; } } else { Line_convert_whitespace(lineResult, PR_FALSE /* Allow wraps */, diff --git a/mozilla/mailnews/mime/src/mimetpla.cpp b/mozilla/mailnews/mime/src/mimetpla.cpp index 136469bbf33..d870ce2cc0f 100644 --- a/mozilla/mailnews/mime/src/mimetpla.cpp +++ b/mozilla/mailnews/mime/src/mimetpla.cpp @@ -189,7 +189,7 @@ MimeInlineTextPlain_parse_begin (MimeObject *obj) /* 4.x' editor can't break
s (e.g. to interleave comments). We'll add the class to the
later. */ { - openingDiv = "
options->wrap_long_lines_p) @@ -249,14 +249,15 @@ MimeInlineTextPlain_parse_eof (MimeObject *obj, PRBool abort_p) MimeInlineTextPlain *text = (MimeInlineTextPlain *) obj; if (text->mIsSig && !quoting) { - status = MimeObject_write(obj, "
", 6, PR_FALSE); // .txt-sig + status = MimeObject_write(obj, "
", 6, PR_FALSE); // .moz-txt-sig if (status < 0) return status; } status = MimeObject_write(obj, "", 6, PR_FALSE); if (status < 0) return status; if (!quoting) { - status = MimeObject_write(obj, "
", 6, PR_FALSE); // .text-plain + status = MimeObject_write(obj, "
", 6, PR_FALSE); + // .moz-text-plain if (status < 0) return status; } @@ -382,8 +383,8 @@ MimeInlineTextPlain_parse_line (char *line, PRInt32 length, MimeObject *obj) // Write plain text quoting tags if (logicalLineStart != 0 && !(plainHTML && text->mBlockquoting)) { - if (!quoting) - prefaceResultStr += ""; + if (!plainHTML) + prefaceResultStr += ""; nsAutoString citeTagsSource; lineSourceStr.Mid(citeTagsSource, 0, logicalLineStart); @@ -406,7 +407,7 @@ MimeInlineTextPlain_parse_line (char *line, PRInt32 length, MimeObject *obj) prefaceResultStr += citeTagsResultCStr; Recycle(citeTagsResultCStr); - if (!quoting) + if (!plainHTML) prefaceResultStr += ""; } @@ -419,7 +420,7 @@ MimeInlineTextPlain_parse_line (char *line, PRInt32 length, MimeObject *obj) { text->mIsSig = PR_TRUE; if (!quoting) - prefaceResultStr += "
"; + prefaceResultStr += "
"; } /* This is the main TXT to HTML conversion: diff --git a/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp b/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp index 6d85721fe02..9ab1380a878 100644 --- a/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp +++ b/mozilla/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp @@ -38,9 +38,6 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); -//#define DEBUG_BenB -//#define DEBUG_BenB_Perf - #ifdef DEBUG_BenB_Perf #include "prtime.h" #include "prinrval.h" @@ -50,7 +47,6 @@ const PRFloat64 growthRate = 1.2; // Escape Char will take ch, escape it and append the result to // aStringToAppendTo - void mozTXTToHTMLConv::EscapeChar(const PRUnichar ch, nsString& aStringToAppendTo) { @@ -377,7 +373,7 @@ mozTXTToHTMLConv::CheckURLAndCreateHTML( // Real work if (NS_SUCCEEDED(rv) && uri) { - outputHTML.AssignWithConversion(""); + aOutString.AppendWithConversion(">"); aOutString.AppendWithConversion(tagTXT); aOutString.AppendWithConversion(""); return PR_TRUE; @@ -605,7 +601,7 @@ mozTXTToHTMLConv::StructPhraseHit(const PRUnichar * aInString, PRInt32 aInString && ItMatchesDelimited(aInString, aInStringLength, tagTXT, aTagTXTLen, LT_ALPHA, LT_DELIMITER)) { openTags--; - aOutString.AppendWithConversion(""); + aOutString.AppendWithConversion(""); aOutString.AppendWithConversion(tagTXT); aOutString.AppendWithConversion("", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, col0, ":)", 2, "\":)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, col0, ":-(", 3, "\":-(\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, col0, ":(", 2, "\":(\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, col0, ";-)", 3, "\";-)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, col0, ";)", 2, "\";)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, col0, ";-P", 3, "\";-P\"", outputHTML, glyphTextLen) + SmilyHit(aInString, aInLength, col0, ":-)", 3, "\":-)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, col0, ":)", 2, "\":)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, col0, ":-(", 3, "\":-(\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, col0, ":(", 2, "\":(\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, col0, ";-)", 3, "\";-)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, col0, ";)", 2, "\";)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, col0, ";-P", 3, "\";-P\"", outputHTML, glyphTextLen) ) ) { @@ -711,13 +707,13 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, PRInt32 aInLength, PRBoo ) && ( - SmilyHit(aInString, aInLength, PR_FALSE, ":-)", 3, "\":-)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, PR_FALSE, ":)", 2, "\":)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, PR_FALSE, ":-(", 3, "\":-(\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, PR_FALSE, ":(", 2, "\":(\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, PR_FALSE, ";-)", 3, "\";-)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, PR_FALSE, ";)", 2, "\";)\"", outputHTML, glyphTextLen) || - SmilyHit(aInString, aInLength, PR_FALSE, ";-P", 3, "\";-P\"", outputHTML, glyphTextLen) + SmilyHit(aInString, aInLength, PR_FALSE, ":-)", 3, "\":-)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, PR_FALSE, ":)", 2, "\":)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, PR_FALSE, ":-(", 3, "\":-(\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, PR_FALSE, ":(", 2, "\":(\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, PR_FALSE, ";-)", 3, "\";-)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, PR_FALSE, ";)", 2, "\";)\"", outputHTML, glyphTextLen) || + SmilyHit(aInString, aInLength, PR_FALSE, ";-P", 3, "\";-P\"", outputHTML, glyphTextLen) ) ) { @@ -770,7 +766,7 @@ mozTXTToHTMLConv::GlyphHit(const PRUnichar * aInString, PRInt32 aInLength, PRBoo outputHTML.Truncate(); outputHTML += text0; - outputHTML.AppendWithConversion(""); + outputHTML.AppendWithConversion(""); aOutputString.Append(outputHTML); aOutputString.Append(&aInString[2], delimPos - 2); @@ -892,19 +888,6 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, PRInt32 aInStringLength, PRBool doURLs = whattodo & kURLs; PRBool doGlyphSubstitution = whattodo & kGlyphSubstitution; PRBool doStructPhrase = whattodo & kStructPhrase; - // DEBUG_BenB_Perf - //doURLs = PR_FALSE; - //doGlyphSubstitution = PR_FALSE; - //doStructPhrase = PR_FALSE; - -#ifdef DEBUG_BenB - { - printf("ScanTXT orginal: "); - nsCString tmp; - tmp.AssignWithConversion(aInString); - printf(tmp.ToNewCString()); - } -#endif MOZ_TIMER_START(mScanTXTTimer); @@ -941,34 +924,35 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, PRInt32 aInStringLength, { case '*': if (StructPhraseHit(newOffset, newLength, i == 0, - "*", 1, "strong", "class=txt-star", + "*", 1, "b", "class=\"moz-txt-star\"", aOutString, structPhrase_strong)) { i++; continue; } break; - case '_': - if (StructPhraseHit(newOffset, newLength, i == 0, - "_", 1, "span" /* is deprecated */, "class=txt-underscore", - aOutString, structPhrase_underline)) - { - i++; - continue; - } - break; case '/': if (StructPhraseHit(newOffset, newLength, i == 0, - "/", 1, "em", "class=txt-slash", + "/", 1, "i", "class=\"moz-txt-slash\"", aOutString, structPhrase_italic)) { i++; continue; } break; + case '_': + if (StructPhraseHit(newOffset, newLength, i == 0, + "_", 1, "span" /* is deprecated */, + "class=\"moz-txt-underscore\"", + aOutString, structPhrase_underline)) + { + i++; + continue; + } + break; case '|': if (StructPhraseHit(newOffset, newLength, i == 0, - "|", 1, "code", "class=txt-verticalline", + "|", 1, "code", "class=\"moz-txt-verticalline\"", aOutString, structPhrase_code)) { i++; @@ -1022,16 +1006,6 @@ mozTXTToHTMLConv::ScanTXT(const PRUnichar * aInString, PRInt32 aInStringLength, } } -#ifdef DEBUG_BenB - { - printf("ScanTXT result: "); - nsCString tmp; - tmp.AssignWithConversion(aOutString); - printf(tmp.ToNewCString()); - printf("\n"); - } -#endif - MOZ_TIMER_STOP(mScanTXTTimer); } @@ -1043,15 +1017,6 @@ mozTXTToHTMLConv::ScanHTML(nsString& aInString, PRUint32 whattodo, nsString &aOu PRInt32 lengthOfInString = aInString.Length(); const PRUnichar * uniBuffer = aInString.GetUnicode(); -#ifdef DEBUG_BenB - { - printf("ScanHTML orginal: "); - nsCString tmp; - tmp.AssignWithConversion(aInString); - printf(tmp.ToNewCString()); - printf("\n"); - } -#endif #ifdef DEBUG_BenB_Perf PRTime parsing_start = PR_IntervalNow(); #endif @@ -1098,15 +1063,6 @@ mozTXTToHTMLConv::ScanHTML(nsString& aInString, PRUint32 whattodo, nsString &aOu } } -#ifdef DEBUG_BenB - { - printf("ScanHTML result: "); - nsCString tmp; - tmp.AssignWithConversion(aOutString); - printf(tmp.ToNewCString()); - printf("\n"); - } -#endif #ifdef DEBUG_BenB_Perf printf("ScanHTML time: %d ms\n", PR_IntervalToMilliseconds(PR_IntervalNow() - parsing_start)); #endif diff --git a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp index 30582bf51a9..de98bc9b5c5 100644 --- a/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp +++ b/mozilla/parser/htmlparser/src/nsHTMLToTXTSinkStream.cpp @@ -472,8 +472,8 @@ PRBool nsHTMLToTXTSinkStream::IsConverted(const nsIParserNode& aNode) NS_SUCCEEDED(rv) && ( - value.EqualsWithConversion("txt", PR_TRUE, 3) || - value.EqualsWithConversion("\"txt", PR_TRUE, 4) + value.EqualsWithConversion("moz-txt", PR_TRUE, 7) || + value.EqualsWithConversion("\"moz-txt", PR_TRUE, 8) ) ); } @@ -908,8 +908,8 @@ nsHTMLToTXTSinkStream::AddLeaf(const nsIParserNode& aNode) } else if (type == eHTMLTag_text) { - /* Check, if some other MUA (e.g. 4.x) recognized the URL in - plain text and inserted an element. If yes, output only once. */ + /* Check, if some other MUA (e.g. 4.x) recognized the URI in + plain text and inserted an element. If yes, output URI only once. */ if (!mURL.IsEmpty() && mURL == text) mURL.Truncate(); if ( @@ -1797,4 +1797,3 @@ PRInt32 unicharwidth(const PRUnichar* pwcs, PRInt32 n) return width; } - diff --git a/mozilla/themes/blue/messenger/mailheader.css b/mozilla/themes/blue/messenger/mailheader.css index 16c8ad8931e..18b743a690d 100644 --- a/mozilla/themes/blue/messenger/mailheader.css +++ b/mozilla/themes/blue/messenger/mailheader.css @@ -31,53 +31,42 @@ body { -.text-flowed tt { - font-family: inherit; -} -.text-flowed blockquote { - margin: 0em 0em; - border-color: black; +.moz-text-flowed blockquote { + margin: inherit; + border-width: medium; + border-color: gray; } -/* Anyhow, the
doesn't inherit whitespace setting from - its parent pre, but from its ancestor .text-plain. */ -.text-plain { +.moz-text-plain pre { + font-family: inherit; + margin: inherit; +} +.moz-text-plain[wrap=true] { white-space: -moz-pre-wrap; } -.text-plain[wrap=false] { +.moz-text-plain[wrap=false] { white-space: pre; } -.text-plain pre { - font-family: inherit; - white-space: inherit; - margin: inherit; +.moz-text-plain[wrap=flow] .moz-txt-sig { + white-space: -moz-pre-wrap; } -/* That's how it should really be -.text-plain pre { - font-family: inherit; - margin: inherit; -} -.text-plain[wrap=false] pre { - white-space: pre; -} -*/ -.text-plain[graphical-quote=false] blockquote { +.moz-text-plain[graphical-quote=false] blockquote { padding-left: inherit; border-left: inherit; - margin: 0em 0em; + margin: inherit; } -.text-plain[graphical-quote=true] blockquote { - margin: 0em 0em; +.moz-text-plain[graphical-quote=true] blockquote { + margin: inherit; border-width: medium; - border-color: black; + border-color: gray; } -.text-plain[graphical-quote=true] .txt-citetags { +.moz-text-plain[graphical-quote=true] .moz-txt-citetags { display: none; } -.txt-sig, .signature { +.moz-txt-sig, .moz-signature { color: gray; } -.txt-sig > a, .signature > a { +.moz-txt-sig > a, .moz-signature > a { color: 7777FF /* light blue */; } diff --git a/mozilla/themes/modern/messenger/mailheader.css b/mozilla/themes/modern/messenger/mailheader.css index 16c8ad8931e..18b743a690d 100644 --- a/mozilla/themes/modern/messenger/mailheader.css +++ b/mozilla/themes/modern/messenger/mailheader.css @@ -31,53 +31,42 @@ body { -.text-flowed tt { - font-family: inherit; -} -.text-flowed blockquote { - margin: 0em 0em; - border-color: black; +.moz-text-flowed blockquote { + margin: inherit; + border-width: medium; + border-color: gray; } -/* Anyhow, the
doesn't inherit whitespace setting from - its parent pre, but from its ancestor .text-plain. */ -.text-plain { +.moz-text-plain pre { + font-family: inherit; + margin: inherit; +} +.moz-text-plain[wrap=true] { white-space: -moz-pre-wrap; } -.text-plain[wrap=false] { +.moz-text-plain[wrap=false] { white-space: pre; } -.text-plain pre { - font-family: inherit; - white-space: inherit; - margin: inherit; +.moz-text-plain[wrap=flow] .moz-txt-sig { + white-space: -moz-pre-wrap; } -/* That's how it should really be -.text-plain pre { - font-family: inherit; - margin: inherit; -} -.text-plain[wrap=false] pre { - white-space: pre; -} -*/ -.text-plain[graphical-quote=false] blockquote { +.moz-text-plain[graphical-quote=false] blockquote { padding-left: inherit; border-left: inherit; - margin: 0em 0em; + margin: inherit; } -.text-plain[graphical-quote=true] blockquote { - margin: 0em 0em; +.moz-text-plain[graphical-quote=true] blockquote { + margin: inherit; border-width: medium; - border-color: black; + border-color: gray; } -.text-plain[graphical-quote=true] .txt-citetags { +.moz-text-plain[graphical-quote=true] .moz-txt-citetags { display: none; } -.txt-sig, .signature { +.moz-txt-sig, .moz-signature { color: gray; } -.txt-sig > a, .signature > a { +.moz-txt-sig > a, .moz-signature > a { color: 7777FF /* light blue */; }