When serializing a <q> as plaintext, put in quotes even if we're not doingformatted output. Bug 378407, r=glazman, sr=sicking
authorbzbarsky@mit.edu
Tue, 05 Jun 2007 12:24:55 -0700
changeset 2142 5dcd50ddc98b9f51ef6d16e97f1b834f375cffda
parent 2141 1adc60ec025bc59f167f060ecb0e0d01ac4f1f33
child 2143 becb51603774b34d79007c2abd99619462d05394
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglazman, sicking
bugs378407
milestone1.9a6pre
When serializing a <q> as plaintext, put in quotes even if we're not doingformatted output. Bug 378407, r=glazman, sr=sicking
content/base/src/nsPlainTextSerializer.cpp
--- a/content/base/src/nsPlainTextSerializer.cpp
+++ b/content/base/src/nsPlainTextSerializer.cpp
@@ -753,16 +753,19 @@ nsPlainTextSerializer::DoOpenContainer(c
       EnsureVerticalSpace(0);
       mCiteQuoteLevel++;
     }
     else {
       EnsureVerticalSpace(1);
       mIndent += kTabSize; // Check for some maximum value?
     }
   }
+  else if (type == eHTMLTag_q) {
+    Write(NS_LITERAL_STRING("\""));
+  }
 
   // Else make sure we'll separate block level tags,
   // even if we're about to leave, before doing any other formatting.
   else if (IsBlockLevel(aTag)) {
     EnsureVerticalSpace(0);
   }
 
   //////////////////////////////////////////////////////////////
@@ -815,19 +818,16 @@ nsPlainTextSerializer::DoOpenContainer(c
   }
   else if (type == eHTMLTag_a && !currentNodeIsConverted) {
     nsAutoString url;
     if (NS_SUCCEEDED(GetAttributeValue(aNode, nsGkAtoms::href, url))
         && !url.IsEmpty()) {
       mURL = url;
     }
   }
-  else if (type == eHTMLTag_q) {
-    Write(NS_LITERAL_STRING("\""));
-  }
   else if (type == eHTMLTag_sup && mStructs && !currentNodeIsConverted) {
     Write(NS_LITERAL_STRING("^"));
   }
   else if (type == eHTMLTag_sub && mStructs && !currentNodeIsConverted) { 
     Write(NS_LITERAL_STRING("_"));
   }
   else if (type == eHTMLTag_code && mStructs && !currentNodeIsConverted) {
     Write(NS_LITERAL_STRING("|"));
@@ -953,16 +953,19 @@ nsPlainTextSerializer::DoCloseContainer(
       mHasWrittenCiteBlockquote = PR_TRUE;
     }
     else {
       mIndent -= kTabSize;
       mFloatingLines = 1;
     }
     mLineBreakDue = PR_TRUE;
   }
+  else if (type == eHTMLTag_q) {
+    Write(NS_LITERAL_STRING("\""));
+  }
   else if (IsBlockLevel(aTag)
            && type != eHTMLTag_script
            && type != eHTMLTag_doctypeDecl
            && type != eHTMLTag_markupDecl) {
     // All other blocks get 1 vertical space after them
     // in formatted mode, otherwise 0.
     // This is hard. Sometimes 0 is a better number, but
     // how to know?
@@ -1005,19 +1008,16 @@ nsPlainTextSerializer::DoCloseContainer(
   else if (type == eHTMLTag_a && !currentNodeIsConverted && !mURL.IsEmpty()) {
     nsAutoString temp; 
     temp.AssignLiteral(" <");
     temp += mURL;
     temp.Append(PRUnichar('>'));
     Write(temp);
     mURL.Truncate();
   }
-  else if (type == eHTMLTag_q) {
-    Write(NS_LITERAL_STRING("\""));
-  }
   else if ((type == eHTMLTag_sup || type == eHTMLTag_sub) 
            && mStructs && !currentNodeIsConverted) {
     Write(kSpace);
   }
   else if (type == eHTMLTag_code && mStructs && !currentNodeIsConverted) {
     Write(NS_LITERAL_STRING("|"));
   }
   else if ((type == eHTMLTag_strong || type == eHTMLTag_b)