Bug 368758 - Remove obsolete workaround pref editor.quotesPreformatted. r=mconley,a=Standard8
authoraceman <acelists@atlas.sk>
Wed, 04 Apr 2012 10:27:26 +0100
changeset 11172 cb2ba44f41aa9cc919c1aba28e28d6bbbfd7a3ef
parent 11171 71030ae61bce5acaee7cab42eacb4639431aed0e
child 11173 a82506eb7e8c0c2a9c35d284ad022132c208ac34
push id463
push userbugzilla@standard8.plus.com
push dateTue, 24 Apr 2012 17:34:51 +0000
treeherdercomm-beta@e53588e8f7b0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, Standard8
bugs368758
Bug 368758 - Remove obsolete workaround pref editor.quotesPreformatted. r=mconley,a=Standard8
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -1992,46 +1992,35 @@ attachmentWorker.onmessage = function(ev
  * @param async Whether we should run the regex checker asynchronously or not.
  * @return true if we should show the attachment notification
  */
 function ShouldShowAttachmentNotification(async)
 {
   let bucket = document.getElementById("attachmentBucket");
   let warn = getPref("mail.compose.attachment_reminder");
   if (warn && !bucket.itemCount) {
-    let prefs = Components.classes["@mozilla.org/preferences-service;1"]
-                          .getService(Components.interfaces.nsIPrefBranch);
-    let keywordsInCsv = prefs.getComplexValue(
-                             "mail.compose.attachment_reminder_keywords",
-                             Components.interfaces.nsIPrefLocalizedString).data;
+    let keywordsInCsv = Services.prefs.getComplexValue(
+      "mail.compose.attachment_reminder_keywords",
+      Components.interfaces.nsIPrefLocalizedString).data;
     let mailBody = document.getElementById("content-frame")
                            .contentDocument.getElementsByTagName("body")[0];
     let mailBodyNode = mailBody.cloneNode(true);
 
     // Don't check quoted text from reply.
     let blockquotes = mailBodyNode.getElementsByTagName("blockquote");
     for (let i = blockquotes.length - 1; i >= 0; i--) {
       blockquotes[i].parentNode.removeChild(blockquotes[i]);
     }
+
     // For plaintext composition the quotes we need to find and exclude are
-    // normally <span _moz_quote="true">. If editor.quotesPreformatted is
-    // set we should exclude <pre _moz_quote="true"> nodes instead.
-    if (!getPref("editor.quotesPreformatted")) {
-      let spans = mailBodyNode.getElementsByTagName("span");
-      for (let i = spans.length - 1; i >= 0; i--) {
-        if (spans[i].hasAttribute("_moz_quote"))
-          spans[i].parentNode.removeChild(spans[i]);
-      }
-    }
-    else {
-      let pres = mailBodyNode.getElementsByTagName("pre");
-      for (let i = pres.length - 1; i >= 0; i--) {
-        if (pres[i].hasAttribute("_moz_quote"))
-          pres[i].parentNode.removeChild(pres[i]);
-      }
+    // <span _moz_quote="true">.
+    let spans = mailBodyNode.getElementsByTagName("span");
+    for (let i = spans.length - 1; i >= 0; i--) {
+      if (spans[i].hasAttribute("_moz_quote"))
+        spans[i].parentNode.removeChild(spans[i]);
     }
 
     // Ignore signature (html compose mode).
     let sigs = mailBodyNode.getElementsByClassName("moz-signature");
     for (let i = sigs.length - 1; i >= 0; i--) {
       sigs[i].parentNode.removeChild(sigs[i]);
     }