Bug 1498041 - Turn on ESLint in mail/base: follow-up - tidy up white-space; rs=white-space-only DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 05 Dec 2018 20:18:11 +1300
changeset 33851 c665681e7f02fa6bf60236e918576fc039b6f060
parent 33850 fae04892480f29b9c9ecc7921954989c0e9f91b4
child 33852 7fd582467790edf2957a5433b818828c71c6c368
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewerswhite-space-only
bugs1498041
Bug 1498041 - Turn on ESLint in mail/base: follow-up - tidy up white-space; rs=white-space-only DONTBUILD
mail/base/content/SearchDialog.js
mail/base/content/commandglue.js
mail/base/content/contentAreaClick.js
mail/base/content/folderPane.js
mail/base/content/mail3PaneWindowCommands.js
mail/base/content/mailTabs.js
mail/base/content/msgMail3PaneWindow.js
mail/base/content/nsDragAndDrop.js
--- a/mail/base/content/SearchDialog.js
+++ b/mail/base/content/SearchDialog.js
@@ -35,100 +35,100 @@ var gViewSearchListener;
 
 var gSearchStopButton;
 
 // Should we try to search online?
 var gSearchOnline = false;
 
 // Controller object for search results thread pane
 var nsSearchResultsController = {
-    supportsCommand(command) {
-        switch (command) {
-        case "cmd_delete":
-        case "cmd_shiftDelete":
-        case "button_delete":
-        case "cmd_open":
-        case "file_message_button":
-        case "open_in_folder_button":
-        case "saveas_vf_button":
-        case "cmd_selectAll":
-            return true;
-        default:
-            return false;
-        }
-    },
+  supportsCommand(command) {
+    switch (command) {
+      case "cmd_delete":
+      case "cmd_shiftDelete":
+      case "button_delete":
+      case "cmd_open":
+      case "file_message_button":
+      case "open_in_folder_button":
+      case "saveas_vf_button":
+      case "cmd_selectAll":
+        return true;
+      default:
+        return false;
+    }
+  },
 
-    // this controller only handles commands
-    // that rely on items being selected in
-    // the search results pane.
-    isCommandEnabled(command) {
-        var enabled = true;
+  // this controller only handles commands
+  // that rely on items being selected in
+  // the search results pane.
+  isCommandEnabled(command) {
+    var enabled = true;
 
-        switch (command) {
-          case "open_in_folder_button":
-            if (gFolderDisplay.selectedCount != 1)
-              enabled = false;
-            break;
-          case "cmd_delete":
-          case "cmd_shiftDelete":
-          case "button_delete":
-            // this assumes that advanced searches don't cross accounts
-            if (gFolderDisplay.selectedCount <= 0)
-              enabled = false;
-            break;
-          case "saveas_vf_button":
-              // need someway to see if there are any search criteria...
-              return true;
-          case "cmd_selectAll":
-            return true;
-          default:
-            if (gFolderDisplay.selectedCount <= 0)
-              enabled = false;
-            break;
-        }
+    switch (command) {
+      case "open_in_folder_button":
+        if (gFolderDisplay.selectedCount != 1)
+          enabled = false;
+        break;
+      case "cmd_delete":
+      case "cmd_shiftDelete":
+      case "button_delete":
+        // this assumes that advanced searches don't cross accounts
+        if (gFolderDisplay.selectedCount <= 0)
+          enabled = false;
+        break;
+      case "saveas_vf_button":
+        // need someway to see if there are any search criteria...
+        return true;
+      case "cmd_selectAll":
+        return true;
+      default:
+        if (gFolderDisplay.selectedCount <= 0)
+          enabled = false;
+        break;
+    }
 
-        return enabled;
-    },
+    return enabled;
+  },
 
-    doCommand(command) {
-        switch (command) {
-        case "cmd_open":
-            MsgOpenSelectedMessages();
-            return true;
+  doCommand(command) {
+    switch (command) {
+      case "cmd_open":
+        MsgOpenSelectedMessages();
+        return true;
 
-        case "cmd_delete":
-        case "button_delete":
-            MsgDeleteSelectedMessages(Ci.nsMsgViewCommandType.deleteMsg);
-            return true;
-        case "cmd_shiftDelete":
-            MsgDeleteSelectedMessages(Ci.nsMsgViewCommandType.deleteNoTrash);
-            return true;
+      case "cmd_delete":
+      case "button_delete":
+        MsgDeleteSelectedMessages(Ci.nsMsgViewCommandType.deleteMsg);
+        return true;
 
-        case "open_in_folder_button":
-            OpenInFolder();
-            return true;
+      case "cmd_shiftDelete":
+        MsgDeleteSelectedMessages(Ci.nsMsgViewCommandType.deleteNoTrash);
+        return true;
 
-        case "saveas_vf_button":
-            saveAsVirtualFolder();
-            return true;
+      case "open_in_folder_button":
+        OpenInFolder();
+        return true;
+
+      case "saveas_vf_button":
+        saveAsVirtualFolder();
+        return true;
 
-        case "cmd_selectAll":
-            // move the focus to the search results pane
-            GetThreadTree().focus();
-            gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectAll);
-            return true;
+      case "cmd_selectAll":
+        // move the focus to the search results pane
+        GetThreadTree().focus();
+        gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectAll);
+        return true;
 
-        default:
-            return false;
-        }
+      default:
+        return false;
+    }
+  },
 
-    },
-
-    onEvent(event) {
-    },
+  onEvent(event) {
+  },
 };
 
 function UpdateMailSearch(caller) {
   document.commandDispatcher.updateCommands("mail-search");
 }
 /**
  * FolderDisplayWidget currently calls this function when the command updater
  *  notification for updateCommandStatus is called.  We don't have a toolbar,
@@ -241,48 +241,48 @@ function searchOnLoad() {
     subjectCol: { visible: true },
     correspondentCol: { visible: Services.prefs.getBoolPref("mail.threadpane.use_correspondents") },
     senderCol: { visible: !Services.prefs.getBoolPref("mail.threadpane.use_correspondents") },
     dateCol: { visible: true },
     locationCol: { visible: true },
   });
 
   if (window.arguments && window.arguments[0])
-      updateSearchFolderPicker(window.arguments[0].folder);
+    updateSearchFolderPicker(window.arguments[0].folder);
 
   // trigger searchTermOverlay.js to create the first criterion
   onMore(null);
   // make sure all the buttons are configured
   UpdateMailSearch("onload");
 }
 
 function searchOnUnload() {
   gFolderDisplay.close();
   top.controllers.removeController(nsSearchResultsController);
 
   // release this early because msgWindow holds a weak reference
   msgWindow.rootDocShell = null;
 }
 
 function initializeSearchWindowWidgets() {
-    gFolderPicker = document.getElementById("searchableFolders");
-    gSearchStopButton = document.getElementById("search-button");
-    hideMatchAllItem();
+  gFolderPicker = document.getElementById("searchableFolders");
+  gSearchStopButton = document.getElementById("search-button");
+  hideMatchAllItem();
 
-    msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
-                  .createInstance(Ci.nsIMsgWindow);
-    msgWindow.domWindow = window;
-    msgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
+  msgWindow = Cc["@mozilla.org/messenger/msgwindow;1"]
+                .createInstance(Ci.nsIMsgWindow);
+  msgWindow.domWindow = window;
+  msgWindow.rootDocShell.appType = Ci.nsIDocShell.APP_TYPE_MAIL;
 
-    gStatusFeedback = new nsMsgStatusFeedback();
-    msgWindow.statusFeedback = gStatusFeedback;
+  gStatusFeedback = new nsMsgStatusFeedback();
+  msgWindow.statusFeedback = gStatusFeedback;
 
-    // functionality to enable/disable buttons using nsSearchResultsController
-    // depending of whether items are selected in the search results thread pane.
-    top.controllers.insertControllerAt(0, nsSearchResultsController);
+  // functionality to enable/disable buttons using nsSearchResultsController
+  // depending of whether items are selected in the search results thread pane.
+  top.controllers.insertControllerAt(0, nsSearchResultsController);
 }
 
 
 function onSearchStop() {
   gFolderDisplay.view.search.session.interruptSearch();
 }
 
 function onResetSearch(event) {
@@ -319,20 +319,20 @@ function UpdateAfterCustomHeaderChange()
   updateSearchAttributes();
 }
 
 function onEnterInSearchTerm() {
   // on enter
   // if not searching, start the search
   // if searching, stop and then start again
   if (gSearchStopButton.getAttribute("label") == gSearchBundle.getString("labelForSearchButton")) {
-     onSearch();
+    onSearch();
   } else {
-     onSearchStop();
-     onSearch();
+    onSearchStop();
+    onSearch();
   }
 }
 
 function onSearch() {
   let viewWrapper = gFolderDisplay.view;
   let searchTerms = getSearchTerms();
 
   viewWrapper.beginViewUpdate();
@@ -489,39 +489,38 @@ function GetScopeForFolder(folder) {
       }
 
       if (!hasBody)
         return nsMsgSearchScope.onlineManual;
         // fall through to default
     default:
       return nsMsgSearchScope.offlineMail;
   }
-
 }
 
 function goUpdateSearchItems(commandset) {
   for (var i = 0; i < commandset.childNodes.length; i++) {
     var commandID = commandset.childNodes[i].getAttribute("id");
     if (commandID) {
       goUpdateCommand(commandID);
     }
   }
 }
 
 // used to toggle functionality for Search/Stop button.
 function onSearchButton(event) {
-    if (event.target.label == gSearchBundle.getString("labelForSearchButton"))
-        onSearch();
-    else
-        onSearchStop();
+  if (event.target.label == gSearchBundle.getString("labelForSearchButton"))
+    onSearch();
+  else
+    onSearchStop();
 }
 
 function MsgDeleteSelectedMessages(aCommandType) {
-    gFolderDisplay.hintAboutToDeleteMessages();
-    gFolderDisplay.doCommand(aCommandType);
+  gFolderDisplay.hintAboutToDeleteMessages();
+  gFolderDisplay.doCommand(aCommandType);
 }
 
 function MoveMessageInSearch(destFolder) {
   // Get the msg folder we're moving messages into.
   // If the id (uri) is not set, use file-uri which is set for
   // "File Here".
   let destUri = destFolder.getAttribute("id");
   if (destUri.length == 0)
--- a/mail/base/content/commandglue.js
+++ b/mail/base/content/commandglue.js
@@ -23,17 +23,17 @@ function UpdateMailToolbar(caller) {
   document.commandDispatcher.updateCommands("mail-toolbar");
 
   // hook for extra toolbar items
   Services.obs.notifyObservers(window, "mail:updateToolbarItems");
 }
 
 function isNewsURI(uri) {
   if (!uri) {
-      return false;
+    return false;
   }
   return uri.startsWith("news:/") || uri.startsWith("news-message:/");
 }
 
 function SwitchView(command) {
   // when switching thread views, we might be coming out of quick search
   // or a message view.
   // first set view picker to all
@@ -63,23 +63,23 @@ function SwitchView(command) {
   }
 }
 
 function SetNewsFolderColumns() {
   var sizeColumn = document.getElementById("sizeCol");
   var bundle = document.getElementById("bundle_messenger");
 
   if (gDBView.usingLines) {
-     sizeColumn.setAttribute("label", bundle.getString("linesColumnHeader"));
-     sizeColumn.setAttribute("tooltiptext",
-                             bundle.getString("linesColumnTooltip2"));
+    sizeColumn.setAttribute("label", bundle.getString("linesColumnHeader"));
+    sizeColumn.setAttribute("tooltiptext",
+                            bundle.getString("linesColumnTooltip2"));
   } else {
-     sizeColumn.setAttribute("label", bundle.getString("sizeColumnHeader"));
-     sizeColumn.setAttribute("tooltiptext",
-                             bundle.getString("sizeColumnTooltip2"));
+    sizeColumn.setAttribute("label", bundle.getString("sizeColumnHeader"));
+    sizeColumn.setAttribute("tooltiptext",
+                            bundle.getString("sizeColumnTooltip2"));
   }
 }
 
 /**
  * For non-folder based tabs, message counts don't apply.
  * Therefore hide the counts for those folders. For folder based tabs
  * let the tab decide whether or not to show it in UpdateStatusMessageCounts().
  */
@@ -96,19 +96,18 @@ var statusMessageCountsMonitor = {
 function UpdateStatusMessageCounts(folder) {
   var unreadElement = document.getElementById("unreadMessageCount");
   var totalElement = document.getElementById("totalMessageCount");
   if (folder && !folder.isServer && unreadElement && totalElement) {
     var numSelected = gFolderDisplay.selectedCount;
     var bundle = document.getElementById("bundle_messenger");
 
     var numUnread = (numSelected > 1) ?
-            bundle.getFormattedString("selectedMsgStatus", [numSelected]) :
-            bundle.getFormattedString("unreadMsgStatus",
-                                      [folder.getNumUnread(false)]);
+      bundle.getFormattedString("selectedMsgStatus", [numSelected]) :
+      bundle.getFormattedString("unreadMsgStatus", [folder.getNumUnread(false)]);
     var numTotal = bundle.getFormattedString("totalMsgStatus",
                                              [folder.getTotalMessages(false)]);
 
     unreadElement.setAttribute("label", numUnread);
     totalElement.setAttribute("label", numTotal);
     unreadElement.hidden = false;
     totalElement.hidden = false;
   }
@@ -324,14 +323,14 @@ function FolderPaneSelectionChange() {
   if (!folderSelection.isSelected(folderSelection.currentIndex))
     return;
 
   gFolderDisplay.show(folders.length ? folders[0] : null);
   SetGetMsgButtonTooltip();
 }
 
 function Undo() {
-    messenger.undo(msgWindow);
+  messenger.undo(msgWindow);
 }
 
 function Redo() {
-    messenger.redo(msgWindow);
+  messenger.redo(msgWindow);
 }
--- a/mail/base/content/contentAreaClick.js
+++ b/mail/base/content/contentAreaClick.js
@@ -2,61 +2,61 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from ../../../../toolkit/content/contentAreaUtils.js */
 /* import-globals-from mailWindow.js */
 /* import-globals-from phishingDetector.js */
 
-  /**
-   * Extract the href from the link click event.
-   * We look for HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement,
-   * HTMLInputElement.form.action, and nested anchor tags.
-   * If the clicked element was a HTMLInputElement or HTMLButtonElement
-   * we return the form action.
-   *
-   * @return href for the url being clicked
-   */
+/**
+ * Extract the href from the link click event.
+ * We look for HTMLAnchorElement, HTMLAreaElement, HTMLLinkElement,
+ * HTMLInputElement.form.action, and nested anchor tags.
+ * If the clicked element was a HTMLInputElement or HTMLButtonElement
+ * we return the form action.
+ *
+ * @return href for the url being clicked
+ */
 
-  ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
-  ChromeUtils.import("resource://gre/modules/Services.jsm");
+ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
+ChromeUtils.import("resource://gre/modules/Services.jsm");
 
-  function hRefForClickEvent(aEvent, aDontCheckInputElement) {
-    var href;
-    var isKeyCommand = (aEvent.type == "command");
-    var target =
-      isKeyCommand ? document.commandDispatcher.focusedElement : aEvent.target;
+function hRefForClickEvent(aEvent, aDontCheckInputElement) {
+  var href;
+  var isKeyCommand = (aEvent.type == "command");
+  var target =
+    isKeyCommand ? document.commandDispatcher.focusedElement : aEvent.target;
 
-    if (target instanceof HTMLAnchorElement ||
-        target instanceof HTMLAreaElement ||
-        target instanceof HTMLLinkElement) {
-      if (target.hasAttribute("href"))
-        href = target.href;
-    } else if (target instanceof HTMLImageElement &&
-               target.hasAttribute("overflowing")) {
-      // Return if an image is zoomed, otherwise fall through to see if it has
-      // a link node.
-      return href;
-    } else if (!aDontCheckInputElement && ((target instanceof HTMLInputElement) ||
-                                           (target instanceof HTMLButtonElement))) {
-      if (target.form && target.form.action)
-        href = target.form.action;
-    } else {
-      // We may be nested inside of a link node.
-      var linkNode = aEvent.originalTarget;
-      while (linkNode && !(linkNode instanceof HTMLAnchorElement))
-        linkNode = linkNode.parentNode;
+  if (target instanceof HTMLAnchorElement ||
+      target instanceof HTMLAreaElement ||
+      target instanceof HTMLLinkElement) {
+    if (target.hasAttribute("href"))
+      href = target.href;
+  } else if (target instanceof HTMLImageElement &&
+             target.hasAttribute("overflowing")) {
+    // Return if an image is zoomed, otherwise fall through to see if it has
+    // a link node.
+    return href;
+  } else if (!aDontCheckInputElement && ((target instanceof HTMLInputElement) ||
+                                         (target instanceof HTMLButtonElement))) {
+    if (target.form && target.form.action)
+      href = target.form.action;
+  } else {
+    // We may be nested inside of a link node.
+    var linkNode = aEvent.originalTarget;
+    while (linkNode && !(linkNode instanceof HTMLAnchorElement))
+      linkNode = linkNode.parentNode;
 
-      if (linkNode)
-        href = linkNode.href;
-    }
+    if (linkNode)
+      href = linkNode.href;
+  }
 
-    return href;
-  }
+  return href;
+}
 
 function messagePaneOnResize(aEvent) {
   // Scale any overflowing images, exclude http content.
   let browser = getBrowser();
   let doc = browser && browser.contentDocument ? browser.contentDocument : null;
   if (!doc || doc.URL.startsWith("http") || !doc.images)
     return;
 
--- a/mail/base/content/folderPane.js
+++ b/mail/base/content/folderPane.js
@@ -2896,127 +2896,127 @@ function getSmartFolderName(aFolder) {
   return gFolderTreeView.getFolderCacheProperty(aFolder, "smartFolderName");
 }
 
 function setSmartFolderName(aFolder, aName) {
   gFolderTreeView.setFolderCacheProperty(aFolder, "smartFolderName", aName);
 }
 
 var gFolderStatsHelpers = {
-    kUnknownSize: "-",
-    sumSubfoldersPref: false,
-    sumSubfolders: false,
-    sizeUnits: "",
-    kiloUnit: "KB",
-    megaUnit: "MB",
+  kUnknownSize: "-",
+  sumSubfoldersPref: false,
+  sumSubfolders: false,
+  sizeUnits: "",
+  kiloUnit: "KB",
+  megaUnit: "MB",
 
-    init() {
-      // We cache these values because the cells in the folder pane columns
-      // using these helpers can be redrawn often.
-      this.sumSubfoldersPref = Services.prefs.getBoolPref("mail.folderpane.sumSubfolders");
-      this.sizeUnits = Services.prefs.getCharPref("mail.folderpane.sizeUnits");
-      this.kiloUnit = gFolderTreeView.messengerBundle.getString("kiloByteAbbreviation2");
-      this.megaUnit = gFolderTreeView.messengerBundle.getString("megaByteAbbreviation2");
-    },
+  init() {
+    // We cache these values because the cells in the folder pane columns
+    // using these helpers can be redrawn often.
+    this.sumSubfoldersPref = Services.prefs.getBoolPref("mail.folderpane.sumSubfolders");
+    this.sizeUnits = Services.prefs.getCharPref("mail.folderpane.sizeUnits");
+    this.kiloUnit = gFolderTreeView.messengerBundle.getString("kiloByteAbbreviation2");
+    this.megaUnit = gFolderTreeView.messengerBundle.getString("megaByteAbbreviation2");
+  },
 
-    /**
-     * Add a prefix to denote the value is actually a sum of all the subfolders.
-     * The prefix is useful as this sum may not always be the exact sum of individual
-     * folders when they are shown expanded (due to rounding to a unit).
-     * E.g. folder1 600bytes -> 1KB, folder2 700bytes -> 1KB
-     * summarized at parent folder: 1300bytes -> 1KB
-     *
-     * @param aValue                  The value to be displayed.
-     * @param aSubfoldersContributed  Boolean indicating whether subfolders
-     *                                contributed to the accumulated total value.
-     */
-    addSummarizedPrefix(aValue, aSubfoldersContributed) {
-      if (!this.sumSubfolders)
-        return aValue;
+  /**
+   * Add a prefix to denote the value is actually a sum of all the subfolders.
+   * The prefix is useful as this sum may not always be the exact sum of individual
+   * folders when they are shown expanded (due to rounding to a unit).
+   * E.g. folder1 600bytes -> 1KB, folder2 700bytes -> 1KB
+   * summarized at parent folder: 1300bytes -> 1KB
+   *
+   * @param aValue                  The value to be displayed.
+   * @param aSubfoldersContributed  Boolean indicating whether subfolders
+   *                                contributed to the accumulated total value.
+   */
+  addSummarizedPrefix(aValue, aSubfoldersContributed) {
+    if (!this.sumSubfolders)
+      return aValue;
 
-      if (!aSubfoldersContributed)
-        return aValue;
+    if (!aSubfoldersContributed)
+      return aValue;
 
-      return gFolderTreeView.messengerBundle
-        .getFormattedString("folderSummarizedSymbolValue", [aValue]);
-    },
+    return gFolderTreeView.messengerBundle
+      .getFormattedString("folderSummarizedSymbolValue", [aValue]);
+  },
 
-    /**
-     * nsIMsgFolder uses -1 as a magic number to mean "I don't know". In those
-     * cases we indicate it to the user. The user has to open the folder
-     * so that the property is initialized from the DB.
-     *
-     * @param aNumber                 The number to translate for the user.
-     * @param aSubfoldersContributed  Boolean indicating whether subfolders
-     *                                contributed to the accumulated total value.
-     */
-    fixNum(aNumber, aSubfoldersContributed) {
-      if (aNumber < 0)
-        return this.kUnknownSize;
+  /**
+   * nsIMsgFolder uses -1 as a magic number to mean "I don't know". In those
+   * cases we indicate it to the user. The user has to open the folder
+   * so that the property is initialized from the DB.
+   *
+   * @param aNumber                 The number to translate for the user.
+   * @param aSubfoldersContributed  Boolean indicating whether subfolders
+   *                                contributed to the accumulated total value.
+   */
+  fixNum(aNumber, aSubfoldersContributed) {
+    if (aNumber < 0)
+      return this.kUnknownSize;
 
-      return (aNumber == 0 ? "" : this.addSummarizedPrefix(aNumber,
-                                                           aSubfoldersContributed));
-    },
+    return (aNumber == 0 ? "" : this.addSummarizedPrefix(aNumber,
+                                                         aSubfoldersContributed));
+  },
 
-    /**
-     * Get the size of the specified folder.
-     *
-     * @param aFolder  The nsIMsgFolder to analyze.
-     */
-    getFolderSize(aFolder) {
-      let folderSize = 0;
-      try {
-        folderSize = aFolder.sizeOnDisk;
-        if (folderSize < 0)
-          return this.kUnknownSize;
-      } catch (ex) {
+  /**
+   * Get the size of the specified folder.
+   *
+   * @param aFolder  The nsIMsgFolder to analyze.
+   */
+  getFolderSize(aFolder) {
+    let folderSize = 0;
+    try {
+      folderSize = aFolder.sizeOnDisk;
+      if (folderSize < 0)
         return this.kUnknownSize;
-      }
-      return folderSize;
-    },
+    } catch (ex) {
+      return this.kUnknownSize;
+    }
+    return folderSize;
+  },
 
-    /**
-     * Get the total size of all subfolders of the specified folder.
-     *
-     * @param aFolder  The nsIMsgFolder to analyze.
-     */
-    getSubfoldersSize(aFolder) {
-      let folderSize = 0;
-      if (aFolder.hasSubFolders) {
-        let subFolders = aFolder.subFolders;
-        while (subFolders.hasMoreElements()) {
-          let subFolder = subFolders.getNext()
-            .QueryInterface(Ci.nsIMsgFolder);
-          let subSize = this.getFolderSize(subFolder);
-          let subSubSize = this.getSubfoldersSize(subFolder);
-          if (subSize == this.kUnknownSize || subSubSize == this.kUnknownSize)
-            return subSize;
+  /**
+   * Get the total size of all subfolders of the specified folder.
+   *
+   * @param aFolder  The nsIMsgFolder to analyze.
+   */
+  getSubfoldersSize(aFolder) {
+    let folderSize = 0;
+    if (aFolder.hasSubFolders) {
+      let subFolders = aFolder.subFolders;
+      while (subFolders.hasMoreElements()) {
+        let subFolder = subFolders.getNext()
+          .QueryInterface(Ci.nsIMsgFolder);
+        let subSize = this.getFolderSize(subFolder);
+        let subSubSize = this.getSubfoldersSize(subFolder);
+        if (subSize == this.kUnknownSize || subSubSize == this.kUnknownSize)
+          return subSize;
 
-          folderSize += subSize + subSubSize;
-        }
+        folderSize += subSize + subSubSize;
       }
-      return folderSize;
-    },
+    }
+    return folderSize;
+  },
 
-    /**
-     * Format the given folder size into a string with an appropriate unit.
-     *
-     * @param aSize  The size in bytes to format.
-     * @param aUnit  Optional unit to use for the format.
-     *               Possible values are "KB" or "MB".
-     * @return       An array with 2 values. First is the resulting formatted strings.
-     *               The second one is the final unit used to format the string.
-     */
-    formatFolderSize(aSize, aUnit = gFolderStatsHelpers.sizeUnits) {
-      let size = Math.round(aSize / 1024);
-      let unit = gFolderStatsHelpers.kiloUnit;
-      // If size is non-zero try to show it in a unit that fits in 3 digits,
-      // but if user specified a fixed unit, use that.
-      if (aUnit != "KB" && (size > 999 || aUnit == "MB")) {
-        size = Math.round(size / 1024);
-        unit = gFolderStatsHelpers.megaUnit;
-        aUnit = "MB";
-      }
-      // This needs to be updated if the "%.*f" placeholder string
-      // in "*ByteAbbreviation2" in messenger.properties changes.
-      return [unit.replace("%.*f", size).replace(" ", ""), aUnit];
-    },
+  /**
+   * Format the given folder size into a string with an appropriate unit.
+   *
+   * @param aSize  The size in bytes to format.
+   * @param aUnit  Optional unit to use for the format.
+   *               Possible values are "KB" or "MB".
+   * @return       An array with 2 values. First is the resulting formatted strings.
+   *               The second one is the final unit used to format the string.
+   */
+  formatFolderSize(aSize, aUnit = gFolderStatsHelpers.sizeUnits) {
+    let size = Math.round(aSize / 1024);
+    let unit = gFolderStatsHelpers.kiloUnit;
+    // If size is non-zero try to show it in a unit that fits in 3 digits,
+    // but if user specified a fixed unit, use that.
+    if (aUnit != "KB" && (size > 999 || aUnit == "MB")) {
+      size = Math.round(size / 1024);
+      unit = gFolderStatsHelpers.megaUnit;
+      aUnit = "MB";
+    }
+    // This needs to be updated if the "%.*f" placeholder string
+    // in "*ByteAbbreviation2" in messenger.properties changes.
+    return [unit.replace("%.*f", size).replace(" ", ""), aUnit];
+  },
 };
--- a/mail/base/content/mail3PaneWindowCommands.js
+++ b/mail/base/content/mail3PaneWindowCommands.js
@@ -485,17 +485,17 @@ var DefaultController = {
       case "cmd_viewUnreadMsgs":
       case "cmd_viewThreadsWithUnread":
       case "cmd_viewWatchedThreadsWithUnread":
         return !gFolderDisplay.view.isVirtual;
       case "cmd_stop":
         return window.MsgStatusFeedback._meteorsSpinning;
       case "cmd_undo":
       case "cmd_redo":
-          return SetupUndoRedoCommand(command);
+        return SetupUndoRedoCommand(command);
       case "cmd_renameFolder":
       {
         let folders = gFolderTreeView.getSelectedFolders();
         return folders.length == 1 && folders[0].canRename &&
                folders[0].isCommandEnabled("cmd_renameFolder");
       }
       case "cmd_sendUnsentMsgs":
         return IsSendUnsentMsgsEnabled(null);
@@ -935,49 +935,49 @@ var DefaultController = {
         return;
       case "cmd_compactFolder":
         gFolderTreeController.compactAllFoldersForAccount();
         return;
       case "button_compact":
         gFolderTreeController.compactFolders();
         return;
       case "cmd_downloadFlagged":
-          gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.downloadFlaggedForOffline);
-          break;
+        gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.downloadFlaggedForOffline);
+        break;
       case "cmd_downloadSelected":
-          gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.downloadSelectedForOffline);
-          break;
+        gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.downloadSelectedForOffline);
+        break;
       case "cmd_synchronizeOffline":
-          MsgSynchronizeOffline();
-          break;
+        MsgSynchronizeOffline();
+        break;
       case "cmd_settingsOffline":
-          MailOfflineMgr.openOfflineAccountSettings();
-          break;
+        MailOfflineMgr.openOfflineAccountSettings();
+        break;
       case "cmd_moveToFolderAgain":
-          var folder = MailUtils.getOrCreateFolder(
-            Services.prefs.getCharPref("mail.last_msg_movecopy_target_uri"));
-          if (Services.prefs.getBoolPref("mail.last_msg_movecopy_was_move"))
-            MsgMoveMessage(folder);
-          else
-            MsgCopyMessage(folder);
-          break;
+        var folder = MailUtils.getOrCreateFolder(
+          Services.prefs.getCharPref("mail.last_msg_movecopy_target_uri"));
+        if (Services.prefs.getBoolPref("mail.last_msg_movecopy_was_move"))
+          MsgMoveMessage(folder);
+        else
+          MsgCopyMessage(folder);
+        break;
       case "cmd_selectAll":
         // XXX If the message pane is selected but the tab focused, this ends
         // closing the message tab. See bug 502834.
         if (aTab.mode.name == "message")
           break;
 
         // move the focus so the user can delete the newly selected messages, not the folder
         SetFocusThreadPane();
         // if in threaded mode, the view will expand all before selecting all
         gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectAll);
         break;
       case "cmd_selectThread":
-          gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectThread);
-          break;
+        gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectThread);
+        break;
       case "cmd_selectFlagged":
         gFolderDisplay.doCommand(Ci.nsMsgViewCommandType.selectFlagged);
         break;
       case "cmd_fullZoomReduce":
         ZoomManager.reduce();
         break;
       case "cmd_fullZoomEnlarge":
         ZoomManager.enlarge();
--- a/mail/base/content/mailTabs.js
+++ b/mail/base/content/mailTabs.js
@@ -178,77 +178,77 @@ var mailTabType = {
           };
           return retval;
         } catch (e) {
           logException(e);
           return null;
         }
       },
       restoreTab(aTabmail, aPersistedState) {
-      try {
-        let folder = MailUtils.getExistingFolder(aPersistedState.folderURI);
-        // if the folder no longer exists, we can't restore the tab
-        if (folder) {
-          let folderPaneVisible = ("folderPaneVisible" in aPersistedState) ?
-                                    aPersistedState.folderPaneVisible :
-                                    true;
-          // If we are talking about the first tab, it already exists and we
-          //  should poke it.  We are assuming it is the currently displayed
-          //  tab because we are privvy to the implementation details and know
-          //  it to be true.
-          if (aPersistedState.firstTab) {
-            // Poke the folder pane box and splitter
-            document.getElementById("folderPaneBox").collapsed =
-              !folderPaneVisible;
-            document.getElementById("folderpane_splitter").setAttribute("state",
-              (folderPaneVisible ? "open" : "collapsed"));
+        try {
+          let folder = MailUtils.getExistingFolder(aPersistedState.folderURI);
+          // if the folder no longer exists, we can't restore the tab
+          if (folder) {
+            let folderPaneVisible = ("folderPaneVisible" in aPersistedState) ?
+                                      aPersistedState.folderPaneVisible :
+                                      true;
+            // If we are talking about the first tab, it already exists and we
+            //  should poke it.  We are assuming it is the currently displayed
+            //  tab because we are privvy to the implementation details and know
+            //  it to be true.
+            if (aPersistedState.firstTab) {
+              // Poke the folder pane box and splitter
+              document.getElementById("folderPaneBox").collapsed =
+                !folderPaneVisible;
+              document.getElementById("folderpane_splitter").setAttribute("state",
+                (folderPaneVisible ? "open" : "collapsed"));
 
-            if (gMessageDisplay.visible != aPersistedState.messagePaneVisible) {
-              MsgToggleMessagePane();
-              // For reasons that are not immediately obvious, sometimes the
-              //  message display is not active at this time.  In that case, we
-              //  need to explicitly set the _visible value because otherwise it
-              //  misses out on the toggle event.
-              if (!gMessageDisplay._active)
-                gMessageDisplay._visible = aPersistedState.messagePaneVisible;
-            }
+              if (gMessageDisplay.visible != aPersistedState.messagePaneVisible) {
+                MsgToggleMessagePane();
+                // For reasons that are not immediately obvious, sometimes the
+                //  message display is not active at this time.  In that case, we
+                //  need to explicitly set the _visible value because otherwise it
+                //  misses out on the toggle event.
+                if (!gMessageDisplay._active)
+                  gMessageDisplay._visible = aPersistedState.messagePaneVisible;
+              }
 
-            if (!("dontRestoreFirstTab" in aPersistedState &&
-                  aPersistedState.dontRestoreFirstTab))
-              gFolderTreeView.selectFolder(folder);
+              if (!("dontRestoreFirstTab" in aPersistedState &&
+                    aPersistedState.dontRestoreFirstTab))
+                gFolderTreeView.selectFolder(folder);
 
-            // We need to manually trigger the tab monitor restore trigger
-            // for this tab.  In theory this should be in tabmail, but the
-            // special nature of the first tab will last exactly long as this
-            // implementation right here so it does not particularly matter
-            // and is a bit more honest, if ugly, to do it here.
-            let tabmail = document.getElementById("tabmail");
-            let restoreState = tabmail._restoringTabState;
-            let tab = tabmail.tabInfo[0];
-            for (let tabMonitor of tabmail.tabMonitors) {
-              if (("onTabRestored" in tabMonitor) &&
-                  (tabMonitor.monitorName in restoreState.ext)) {
-                tabMonitor.onTabRestored(tab,
-                                         restoreState.ext[tabMonitor.monitorName],
-                                         true);
+              // We need to manually trigger the tab monitor restore trigger
+              // for this tab.  In theory this should be in tabmail, but the
+              // special nature of the first tab will last exactly long as this
+              // implementation right here so it does not particularly matter
+              // and is a bit more honest, if ugly, to do it here.
+              let tabmail = document.getElementById("tabmail");
+              let restoreState = tabmail._restoringTabState;
+              let tab = tabmail.tabInfo[0];
+              for (let tabMonitor of tabmail.tabMonitors) {
+                if (("onTabRestored" in tabMonitor) &&
+                    (tabMonitor.monitorName in restoreState.ext)) {
+                  tabMonitor.onTabRestored(tab,
+                                           restoreState.ext[tabMonitor.monitorName],
+                                           true);
+                }
               }
+            } else {
+              let tabArgs = {
+                folder,
+                folderPaneVisible,
+                messagePaneVisible: aPersistedState.messagePaneVisible,
+                background: true,
+              };
+              aTabmail.openTab("folder", tabArgs);
             }
-          } else {
-            let tabArgs = {
-              folder,
-              folderPaneVisible,
-              messagePaneVisible: aPersistedState.messagePaneVisible,
-              background: true,
-            };
-            aTabmail.openTab("folder", tabArgs);
           }
+        } catch (e) {
+          logException(e);
         }
-      } catch (e) {
-        logException(e);
-      }
       },
       onTitleChanged(aTab, aTabNode) {
         if (!aTab.folderDisplay || !aTab.folderDisplay.displayedFolder) {
           // Don't show "undefined" as title when there is no account.
           aTab.title = " ";
           return;
         }
         // The user may have changed folders, triggering our onTitleChanged
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -83,29 +83,29 @@ function getWindowsVersionInfo() {
   const DWORD = ctypes.uint32_t;
   const WCHAR = ctypes.char16_t;
   const BOOL = ctypes.int;
 
   // This structure is described at:
   // http://msdn.microsoft.com/en-us/library/ms724833%28v=vs.85%29.aspx
   const SZCSDVERSIONLENGTH = 128;
   const OSVERSIONINFOEXW = new ctypes.StructType("OSVERSIONINFOEXW",
-      [
+    [
       {dwOSVersionInfoSize: DWORD},
       {dwMajorVersion: DWORD},
       {dwMinorVersion: DWORD},
       {dwBuildNumber: DWORD},
       {dwPlatformId: DWORD},
       {szCSDVersion: ctypes.ArrayType(WCHAR, SZCSDVERSIONLENGTH)},
       {wServicePackMajor: WORD},
       {wServicePackMinor: WORD},
       {wSuiteMask: WORD},
       {wProductType: BYTE},
       {wReserved: BYTE},
-      ]);
+    ]);
 
   let kernel32 = ctypes.open("kernel32");
   try {
     let GetVersionEx = kernel32.declare("GetVersionExW",
                                         ctypes.winapi_abi,
                                         BOOL,
                                         OSVERSIONINFOEXW.ptr);
     let winVer = OSVERSIONINFOEXW();
@@ -162,60 +162,60 @@ var gNewAccountToLoad = null;
 
 var gDisplayStartupPage = false;
 
 // The object in charge of managing the mail summary pane
 var gSummaryFrameManager;
 
 // the folderListener object
 var folderListener = {
-    OnItemAdded(parentItem, item) {},
+  OnItemAdded(parentItem, item) {},
 
-    OnItemRemoved(parentItem, item) {},
+  OnItemRemoved(parentItem, item) {},
 
-    OnItemPropertyChanged(item, property, oldValue, newValue) {},
+  OnItemPropertyChanged(item, property, oldValue, newValue) {},
 
-    OnItemIntPropertyChanged(item, property, oldValue, newValue) {
-      if (item == gFolderDisplay.displayedFolder) {
-        if (property == "TotalMessages" || property == "TotalUnreadMessages") {
-          UpdateStatusMessageCounts(gFolderDisplay.displayedFolder);
-        }
+  OnItemIntPropertyChanged(item, property, oldValue, newValue) {
+    if (item == gFolderDisplay.displayedFolder) {
+      if (property == "TotalMessages" || property == "TotalUnreadMessages") {
+        UpdateStatusMessageCounts(gFolderDisplay.displayedFolder);
       }
-    },
+    }
+  },
 
-    OnItemBoolPropertyChanged(item, property, oldValue, newValue) {},
+  OnItemBoolPropertyChanged(item, property, oldValue, newValue) {},
 
-    OnItemUnicharPropertyChanged(item, property, oldValue, newValue) {},
-    OnItemPropertyFlagChanged(item, property, oldFlag, newFlag) {},
+  OnItemUnicharPropertyChanged(item, property, oldValue, newValue) {},
+  OnItemPropertyFlagChanged(item, property, oldFlag, newFlag) {},
 
-    OnItemEvent(folder, event) {
-      if (event == "ImapHdrDownloaded") {
-        if (folder) {
-          var imapFolder = folder.QueryInterface(Ci.nsIMsgImapMailFolder);
-          if (imapFolder) {
-            var hdrParser = imapFolder.hdrParser;
-            if (hdrParser) {
-              var msgHdr = hdrParser.GetNewMsgHdr();
-              if (msgHdr) {
-                var hdrs = hdrParser.headers;
-                if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) {
-                  msgHdr.OrFlags(Ci.nsMsgMessageFlags
-                                   .Attachment);
-                }
-                if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
-                  msgHdr.setStringProperty("imageSize", "1");
-                }
+  OnItemEvent(folder, event) {
+    if (event == "ImapHdrDownloaded") {
+      if (folder) {
+        var imapFolder = folder.QueryInterface(Ci.nsIMsgImapMailFolder);
+        if (imapFolder) {
+          var hdrParser = imapFolder.hdrParser;
+          if (hdrParser) {
+            var msgHdr = hdrParser.GetNewMsgHdr();
+            if (msgHdr) {
+              var hdrs = hdrParser.headers;
+              if (hdrs && hdrs.indexOf("X-attachment-size:") > 0) {
+                msgHdr.OrFlags(Ci.nsMsgMessageFlags
+                                 .Attachment);
+              }
+              if (hdrs && hdrs.indexOf("X-image-size:") > 0) {
+                msgHdr.setStringProperty("imageSize", "1");
               }
             }
           }
         }
-      } else if (event == "JunkStatusChanged") {
-        HandleJunkStatusChanged(folder);
       }
-    },
+    } else if (event == "JunkStatusChanged") {
+      HandleJunkStatusChanged(folder);
+    }
+  },
 };
 
 function ServerContainsFolder(server, folder) {
   if (!folder || !server)
     return false;
 
   return server.equals(folder.server);
 }
@@ -223,62 +223,62 @@ function ServerContainsFolder(server, fo
 function SelectServer(server) {
   gFolderTreeView.selectFolder(server.rootFolder);
 }
 
 // we have this incoming server listener in case we need to
 // alter the folder pane selection when a server is removed
 // or changed (currently, when the real username or real hostname change)
 var gThreePaneIncomingServerListener = {
-    onServerLoaded(server) {},
-    onServerUnloaded(server) {
-      let defaultAccount = accountManager.defaultAccount;
-      if (!defaultAccount) {
-       // If there is no default server we have nothing to do.
-       return;
-      }
+  onServerLoaded(server) {},
+  onServerUnloaded(server) {
+    let defaultAccount = accountManager.defaultAccount;
+    if (!defaultAccount) {
+     // If there is no default server we have nothing to do.
+     return;
+    }
 
-      let defaultServer = defaultAccount.incomingServer;
-      var selectedFolders = GetSelectedMsgFolders();
-      for (var i = 0; i < selectedFolders.length; i++) {
-        if (ServerContainsFolder(server, selectedFolders[i])) {
-          SelectServer(defaultServer);
-          // we've made a new selection, we're done
-          return;
-        }
-      }
-
-      // if nothing is selected at this point, better go select the default
-      // this could happen if nothing was selected when the server was removed
-      selectedFolders = GetSelectedMsgFolders();
-      if (selectedFolders.length == 0) {
+    let defaultServer = defaultAccount.incomingServer;
+    var selectedFolders = GetSelectedMsgFolders();
+    for (var i = 0; i < selectedFolders.length; i++) {
+      if (ServerContainsFolder(server, selectedFolders[i])) {
         SelectServer(defaultServer);
+        // we've made a new selection, we're done
+        return;
       }
-    },
-    onServerChanged(server) {
-      // if the current selected folder is on the server that changed
-      // and that server is an imap or news server,
-      // we need to update the selection.
-      // on those server types, we'll be reconnecting to the server
-      // and our currently selected folder will need to be reloaded
-      // or worse, be invalid.
-      if (server.type != "imap" && server.type != "nntp")
-        return;
+    }
 
-      var selectedFolders = GetSelectedMsgFolders();
-      for (var i = 0; i < selectedFolders.length; i++) {
-        // if the selected item is a server, we don't have to update
-        // the selection
-        if (!(selectedFolders[i].isServer) && ServerContainsFolder(server, selectedFolders[i])) {
-          SelectServer(server);
-          // we've made a new selection, we're done
-          return;
-        }
+    // if nothing is selected at this point, better go select the default
+    // this could happen if nothing was selected when the server was removed
+    selectedFolders = GetSelectedMsgFolders();
+    if (selectedFolders.length == 0) {
+      SelectServer(defaultServer);
+    }
+  },
+  onServerChanged(server) {
+    // if the current selected folder is on the server that changed
+    // and that server is an imap or news server,
+    // we need to update the selection.
+    // on those server types, we'll be reconnecting to the server
+    // and our currently selected folder will need to be reloaded
+    // or worse, be invalid.
+    if (server.type != "imap" && server.type != "nntp")
+      return;
+
+    var selectedFolders = GetSelectedMsgFolders();
+    for (var i = 0; i < selectedFolders.length; i++) {
+      // if the selected item is a server, we don't have to update
+      // the selection
+      if (!(selectedFolders[i].isServer) && ServerContainsFolder(server, selectedFolders[i])) {
+        SelectServer(server);
+        // we've made a new selection, we're done
+        return;
       }
-    },
+    }
+  },
 };
 
 // aMsgWindowInitialized: false if we are calling from the onload handler, otherwise true
 function UpdateMailPaneConfig(aMsgWindowInitialized) {
   const dynamicIds = ["messagesBox", "mailContent", "threadPaneBox"];
   const layouts = ["standard", "wide", "vertical"];
   var layoutView = Services.prefs.getIntPref("mail.pane_config.dynamic");
   // Ensure valid value; hard fail if not.
@@ -838,115 +838,115 @@ function loadExtraTabs() {
 function loadStartMsgHdr(aStartMsgHdr) {
   // We'll just clobber the default tab
   atStartupRestoreTabs(true);
 
   MsgDisplayMessageInFolderTab(aStartMsgHdr);
 }
 
 function loadStartFolder(initialUri) {
-    var defaultServer = null;
-    var startFolder;
-    var isLoginAtStartUpEnabled = false;
-
-    // If a URI was explicitly specified, we'll just clobber the default tab
-    let loadFolder = !atStartupRestoreTabs(!!initialUri);
-
-    if (initialUri)
-      loadFolder = true;
+  var defaultServer = null;
+  var startFolder;
+  var isLoginAtStartUpEnabled = false;
 
-    // First get default account
-    try {
-        if (initialUri) {
-            startFolder = MailUtils.getOrCreateFolder(initialUri);
-        } else {
-            let defaultAccount = accountManager.defaultAccount;
-            if (!defaultAccount)
-                return;
+  // If a URI was explicitly specified, we'll just clobber the default tab
+  let loadFolder = !atStartupRestoreTabs(!!initialUri);
 
-            defaultServer = defaultAccount.incomingServer;
-            var rootMsgFolder = defaultServer.rootMsgFolder;
+  if (initialUri)
+    loadFolder = true;
 
-            startFolder = rootMsgFolder;
-
-            // Enable check new mail once by turning checkmail pref 'on' to bring
-            // all users to one plane. This allows all users to go to Inbox. User can
-            // always go to server settings panel and turn off "Check for new mail at startup"
-            if (!Services.prefs.getBoolPref(kMailCheckOncePrefName)) {
-                Services.prefs.setBoolPref(kMailCheckOncePrefName, true);
-                defaultServer.loginAtStartUp = true;
-            }
+  // First get default account
+  try {
+    if (initialUri) {
+        startFolder = MailUtils.getOrCreateFolder(initialUri);
+    } else {
+        let defaultAccount = accountManager.defaultAccount;
+        if (!defaultAccount)
+            return;
 
-            // Get the user pref to see if the login at startup is enabled for default account
-            isLoginAtStartUpEnabled = defaultServer.loginAtStartUp;
+        defaultServer = defaultAccount.incomingServer;
+        var rootMsgFolder = defaultServer.rootMsgFolder;
+
+        startFolder = rootMsgFolder;
 
-            // Get Inbox only if login at startup is enabled.
-            if (isLoginAtStartUpEnabled) {
-                // now find Inbox
-                var inboxFolder = rootMsgFolder.getFolderWithFlags(Ci.nsMsgFolderFlags.Inbox);
-                if (!inboxFolder) return;
-
-                startFolder = inboxFolder;
-            }
+        // Enable check new mail once by turning checkmail pref 'on' to bring
+        // all users to one plane. This allows all users to go to Inbox. User can
+        // always go to server settings panel and turn off "Check for new mail at startup"
+        if (!Services.prefs.getBoolPref(kMailCheckOncePrefName)) {
+            Services.prefs.setBoolPref(kMailCheckOncePrefName, true);
+            defaultServer.loginAtStartUp = true;
         }
 
-        // it is possible we were given an initial uri and we need to subscribe or try to add
-        // the folder. i.e. the user just clicked on a news folder they aren't subscribed to from a browser
-        // the news url comes in here.
+        // Get the user pref to see if the login at startup is enabled for default account
+        isLoginAtStartUpEnabled = defaultServer.loginAtStartUp;
 
-        // Perform biff on the server to check for new mail, except for imap
-        // or a pop3 account that is deferred or deferred to,
-        // or the case where initialUri is non-null (non-startup)
-        if (!initialUri && isLoginAtStartUpEnabled
-            && !defaultServer.isDeferredTo &&
-            defaultServer.rootFolder == defaultServer.rootMsgFolder)
-          defaultServer.performBiff(msgWindow);
-        if (loadFolder) {
-          try {
-            gFolderTreeView.selectFolder(startFolder);
-          } catch (ex) {
-            // This means we tried to select a folder that isn't in the current
-            // view. Just select the first one in the view then.
-            if (gFolderTreeView._rowMap.length)
-              gFolderTreeView.selectFolder(gFolderTreeView._rowMap[0]._folder);
-          }
+        // Get Inbox only if login at startup is enabled.
+        if (isLoginAtStartUpEnabled) {
+            // now find Inbox
+            var inboxFolder = rootMsgFolder.getFolderWithFlags(Ci.nsMsgFolderFlags.Inbox);
+            if (!inboxFolder) return;
+
+            startFolder = inboxFolder;
         }
-    } catch (ex) {
-      // this is the case where we're trying to auto-subscribe to a folder.
-      if (initialUri && !startFolder.parent) {
-        // hack to force display of thread pane.
-        if (IsMessagePaneCollapsed) {
-          MsgToggleMessagePane();
-        }
-        messenger.loadURL(window, initialUri);
-        return;
-      }
-
-      Cu.reportError(ex);
     }
 
-    MsgGetMessagesForAllServers(defaultServer);
+    // it is possible we were given an initial uri and we need to subscribe or try to add
+    // the folder. i.e. the user just clicked on a news folder they aren't subscribed to from a browser
+    // the news url comes in here.
 
-    if (MailOfflineMgr.isOnline()) {
-      // Check if we shut down offline, and restarted online, in which case
-      // we may have offline events to playback. Since this is not a pref
-      // the user should set, it's not in mailnews.js, so we need a try catch.
-      let playbackOfflineEvents = Services.prefs.getBoolPref("mailnews.playback_offline", false);
-      if (playbackOfflineEvents) {
-        Services.prefs.setBoolPref("mailnews.playback_offline", false);
-        MailOfflineMgr.offlineManager.goOnline(false, true, msgWindow);
+    // Perform biff on the server to check for new mail, except for imap
+    // or a pop3 account that is deferred or deferred to,
+    // or the case where initialUri is non-null (non-startup)
+    if (!initialUri && isLoginAtStartUpEnabled
+        && !defaultServer.isDeferredTo &&
+        defaultServer.rootFolder == defaultServer.rootMsgFolder)
+      defaultServer.performBiff(msgWindow);
+    if (loadFolder) {
+      try {
+        gFolderTreeView.selectFolder(startFolder);
+      } catch (ex) {
+        // This means we tried to select a folder that isn't in the current
+        // view. Just select the first one in the view then.
+        if (gFolderTreeView._rowMap.length)
+          gFolderTreeView.selectFolder(gFolderTreeView._rowMap[0]._folder);
+      }
+    }
+  } catch (ex) {
+    // this is the case where we're trying to auto-subscribe to a folder.
+    if (initialUri && !startFolder.parent) {
+      // hack to force display of thread pane.
+      if (IsMessagePaneCollapsed) {
+        MsgToggleMessagePane();
       }
+      messenger.loadURL(window, initialUri);
+      return;
+    }
 
-      // If appropriate, send unsent messages. This may end up prompting the user,
-      // so we need to get it out of the flow of the normal load sequence.
-      setTimeout(function() {
-        if (MailOfflineMgr.shouldSendUnsentMessages())
-          SendUnsentMessages();
-      }, 0);
+    Cu.reportError(ex);
+  }
+
+  MsgGetMessagesForAllServers(defaultServer);
+
+  if (MailOfflineMgr.isOnline()) {
+    // Check if we shut down offline, and restarted online, in which case
+    // we may have offline events to playback. Since this is not a pref
+    // the user should set, it's not in mailnews.js, so we need a try catch.
+    let playbackOfflineEvents = Services.prefs.getBoolPref("mailnews.playback_offline", false);
+    if (playbackOfflineEvents) {
+      Services.prefs.setBoolPref("mailnews.playback_offline", false);
+      MailOfflineMgr.offlineManager.goOnline(false, true, msgWindow);
     }
+
+    // If appropriate, send unsent messages. This may end up prompting the user,
+    // so we need to get it out of the flow of the normal load sequence.
+    setTimeout(function() {
+      if (MailOfflineMgr.shouldSendUnsentMessages())
+        SendUnsentMessages();
+    }, 0);
+  }
 }
 
 function AddToSession() {
   var nsIFolderListener = Ci.nsIFolderListener;
   var notifyFlags = nsIFolderListener.intPropertyChanged | nsIFolderListener.event;
   MailServices.mailSession.AddFolderListener(folderListener, notifyFlags);
 }
 
@@ -1048,17 +1048,17 @@ function ClearMessagePane() {
     // This can fail because cloning imap URI's can fail if the username
     // has been cleared by docshell/base/nsDefaultURIFixup.cpp.
     let messagePane = GetMessagePaneFrame();
     // If we don't do this check, no one else does and we do a non-trivial
     // amount of work.  So do the check.
     if (messagePane.location.href != "about:blank")
       messagePane.location.href = "about:blank";
   } catch (ex) {
-      logException(ex, false, "error clearing message pane");
+    logException(ex, false, "error clearing message pane");
   }
 }
 
 /**
  * When right-clicks happen, we do not want to corrupt the underlying
  * selection.  The right-click is a transient selection.  So, unless the
  * user is right-clicking on the current selection, we create a new
  * selection object (thanks to JSTreeSelection) and set that as the
@@ -1121,25 +1121,25 @@ function ChangeSelectionWithoutContentLo
     transientSelection.select(row);
     transientSelection.currentIndex = saveCurrentIndex;
     treeBoxObj.ensureRowIsVisible(row);
   }
   event.stopPropagation();
 }
 
 function TreeOnMouseDown(event) {
-    // Detect right mouse click and change the highlight to the row
-    // where the click happened without loading the message headers in
-    // the Folder or Thread Pane.
-    // Same for middle click, which will open the folder/message in a tab.
-    if (event.button == 2 || event.button == 1) {
-      // We want a single selection if this is a middle-click (button 1)
-      ChangeSelectionWithoutContentLoad(event, event.target.parentNode,
-                                        event.button == 1);
-    }
+  // Detect right mouse click and change the highlight to the row
+  // where the click happened without loading the message headers in
+  // the Folder or Thread Pane.
+  // Same for middle click, which will open the folder/message in a tab.
+  if (event.button == 2 || event.button == 1) {
+    // We want a single selection if this is a middle-click (button 1)
+    ChangeSelectionWithoutContentLoad(event, event.target.parentNode,
+                                      event.button == 1);
+  }
 }
 
 function FolderPaneContextMenuNewTab(event) {
   var bgLoad = Services.prefs.getBoolPref("mail.tabs.loadInBackground");
   if (event.shiftKey)
     bgLoad = !bgLoad;
   MsgOpenNewTabForFolder(bgLoad);
 }
@@ -1295,17 +1295,17 @@ function MigrateOpenMessageBehavior() {
 }
 
 function ThreadPaneOnDragStart(aEvent) {
   if (aEvent.originalTarget.localName != "treechildren")
     return;
 
   let messageUris = gFolderDisplay.selectedMessageUris;
   if (!messageUris)
-     return;
+    return;
 
   gFolderDisplay.hintAboutToDeleteMessages();
   let messengerBundle = document.getElementById("bundle_messenger");
   let noSubjectString = messengerBundle.getString("defaultSaveMessageAsFileName");
   if (noSubjectString.endsWith(".eml"))
     noSubjectString = noSubjectString.slice(0, -4);
   let longSubjectTruncator = messengerBundle.getString("longMsgSubjectTruncator");
   // Clip the subject string to 124 chars to avoid problems on Windows,
@@ -1351,17 +1351,16 @@ function ThreadPaneOnDragStart(aEvent) {
 
     aEvent.dataTransfer.mozSetDataAt("text/x-moz-message", msgUri, index);
     aEvent.dataTransfer.mozSetDataAt("text/x-moz-url", msgUrl.value.spec, index);
     aEvent.dataTransfer.mozSetDataAt("application/x-moz-file-promise-url",
                                      msgUrl.value.spec + "?fileName=" +
                                      encodeURIComponent(msgFileName), index);
     aEvent.dataTransfer.mozSetDataAt("application/x-moz-file-promise",
                                      new messageFlavorDataProvider(), index);
-
   }
 
   aEvent.dataTransfer.effectAllowed = "copyMove";
   aEvent.dataTransfer.addElement(aEvent.originalTarget);
 }
 
 function messageFlavorDataProvider() {
 }
--- a/mail/base/content/nsDragAndDrop.js
+++ b/mail/base/content/nsDragAndDrop.js
@@ -27,38 +27,38 @@ var nsTransferable = {
    * nsITransferable set (TransferData aTransferData) ;
    *
    * Creates a transferable with data for a list of supported types ("flavours")
    *
    * @param TransferData aTransferData
    *        a javascript object in the format described above
    **/
   set(aTransferDataSet) {
-      var trans = this.createTransferable();
-      for (var i = 0; i < aTransferDataSet.dataList.length; ++i) {
-          var currData = aTransferDataSet.dataList[i];
-          var currFlavour = currData.flavour.contentType;
-          trans.addDataFlavor(currFlavour);
-          var supports = null; // nsISupports data
-          var length = 0;
-          if (currData.flavour.dataIIDKey == "nsISupportsString") {
-              supports = Cc["@mozilla.org/supports-string;1"]
-                           .createInstance(Ci.nsISupportsString);
+    var trans = this.createTransferable();
+    for (var i = 0; i < aTransferDataSet.dataList.length; ++i) {
+      var currData = aTransferDataSet.dataList[i];
+      var currFlavour = currData.flavour.contentType;
+      trans.addDataFlavor(currFlavour);
+      var supports = null; // nsISupports data
+      var length = 0;
+      if (currData.flavour.dataIIDKey == "nsISupportsString") {
+          supports = Cc["@mozilla.org/supports-string;1"]
+                       .createInstance(Ci.nsISupportsString);
 
-              supports.data = currData.supports;
-              length = supports.data.length;
-            } else {
-              // non-string data.
-              supports = currData.supports;
-              length = 0; // kFlavorHasDataProvider
-            }
-          trans.setTransferData(currFlavour, supports, length * 2);
-        }
-      return trans;
-    },
+        supports.data = currData.supports;
+        length = supports.data.length;
+      } else {
+        // non-string data.
+        supports = currData.supports;
+        length = 0; // kFlavorHasDataProvider
+      }
+      trans.setTransferData(currFlavour, supports, length * 2);
+    }
+    return trans;
+  },
 
   /**
    * TransferData/TransferDataSet get (FlavourSet aFlavourSet,
    *                                   Function aRetrievalFunc, Boolean aAnyFlag) ;
    *
    * Retrieves data from the transferable provided in aRetrievalFunc, formatted
    * for more convenient access.
    *
@@ -68,63 +68,63 @@ var nsTransferable = {
    *        a reference to a function that returns a nsIArray of nsITransferables
    *        for each item from the specified source (clipboard/drag&drop etc)
    * @param Boolean aAnyFlag
    *        a flag specifying whether or not a specific flavour is requested. If false,
    *        data of the type of the first flavour in the flavourlist parameter is returned,
    *        otherwise the best flavour supported will be returned.
    **/
   get(aFlavourSet, aRetrievalFunc, aAnyFlag) {
-      if (!aRetrievalFunc)
-        throw "No data retrieval handler provided!";
+    if (!aRetrievalFunc)
+      throw "No data retrieval handler provided!";
 
-      var array = aRetrievalFunc(aFlavourSet);
-      var dataArray = [];
+    var array = aRetrievalFunc(aFlavourSet);
+    var dataArray = [];
 
-      // Iterate over the number of items returned from aRetrievalFunc. For
-      // clipboard operations, this is 1, for drag and drop (where multiple
-      // items may have been dragged) this could be >1.
-      for (let i = 0; i < array.length; i++) {
-          let trans = array.queryElementAt(i, Ci.nsITransferable);
-          if (!trans)
-            continue;
+    // Iterate over the number of items returned from aRetrievalFunc. For
+    // clipboard operations, this is 1, for drag and drop (where multiple
+    // items may have been dragged) this could be >1.
+    for (let i = 0; i < array.length; i++) {
+      let trans = array.queryElementAt(i, Ci.nsITransferable);
+      if (!trans)
+        continue;
 
-          var data = {};
-          var length = {};
+      var data = {};
+      var length = {};
 
-          if (aAnyFlag) {
-              var flavour = {};
-              trans.getAnyTransferData(flavour, data, length);
-              if (data && flavour) {
-                  var selectedFlavour = aFlavourSet.flavourTable[flavour.value];
-                  if (selectedFlavour)
-                    dataArray[i] = FlavourToXfer(data.value, length.value, selectedFlavour);
-                }
-            } else {
-              var firstFlavour = aFlavourSet.flavours[0];
-              trans.getTransferData(firstFlavour, data, length);
-              if (data && firstFlavour)
-                dataArray[i] = FlavourToXfer(data.value, length.value, firstFlavour);
-            }
+      if (aAnyFlag) {
+        var flavour = {};
+        trans.getAnyTransferData(flavour, data, length);
+        if (data && flavour) {
+          var selectedFlavour = aFlavourSet.flavourTable[flavour.value];
+          if (selectedFlavour)
+            dataArray[i] = FlavourToXfer(data.value, length.value, selectedFlavour);
         }
-      return new TransferDataSet(dataArray);
-    },
+      } else {
+        var firstFlavour = aFlavourSet.flavours[0];
+        trans.getTransferData(firstFlavour, data, length);
+        if (data && firstFlavour)
+          dataArray[i] = FlavourToXfer(data.value, length.value, firstFlavour);
+      }
+    }
+    return new TransferDataSet(dataArray);
+  },
 
   /**
    * nsITransferable createTransferable (void) ;
    *
    * Creates and returns a transferable object.
    **/
   createTransferable() {
-      const kXferableContractID = "@mozilla.org/widget/transferable;1";
-      const kXferableIID = Ci.nsITransferable;
-      var trans = Cc[kXferableContractID].createInstance(kXferableIID);
-      trans.init(null);
-      return trans;
-    },
+    const kXferableContractID = "@mozilla.org/widget/transferable;1";
+    const kXferableIID = Ci.nsITransferable;
+    var trans = Cc[kXferableContractID].createInstance(kXferableIID);
+    trans.init(null);
+    return trans;
+  },
 };
 
 /**
  * A FlavourSet is a simple type that represents a collection of Flavour objects.
  * FlavourSet is constructed from an array of Flavours, and stores this list as
  * an array and a hashtable. The rationale for the dual storage is as follows:
  *
  * Array: Ordering is important when adding data flavours to a transferable.
@@ -239,33 +239,31 @@ FlavourData.prototype = {
  * Create a TransferData object with a single FlavourData entry. Used when
  * unwrapping data of a specific flavour from the drag service.
  */
 function FlavourToXfer(aData, aLength, aFlavour) {
   return new TransferData([new FlavourData(aData, aLength, aFlavour)]);
 }
 
 var transferUtils = {
-
   retrieveURLFromData(aData, flavour) {
     switch (flavour) {
       case "text/unicode":
       case "text/plain":
       case "text/x-moz-text-internal":
         return aData.replace(/^\s+|\s+$/g, "");
       case "text/x-moz-url":
         return ((aData instanceof Ci.nsISupportsString) ? aData.toString() : aData).split("\n")[0];
       case "application/x-moz-file":
         var fileHandler = Services.io.getProtocolHandler("file")
                                      .QueryInterface(Ci.nsIFileProtocolHandler);
         return fileHandler.getURLSpecFromFile(aData);
     }
     return null;
   },
-
 };
 
 /**
  * nsDragAndDrop - a convenience wrapper for nsTransferable, nsITransferable
  *                 and nsIDragService/nsIDragSession.
  *
  * Use: map the handler functions to the 'ondraggesture', 'ondragover' and
  *   'ondragdrop' event handlers on your XML element, e.g.
@@ -287,272 +285,271 @@ var transferUtils = {
  *                                       // nsTransferable can determine
  *                                       // whether or not to accept drop.
  **/
 
 var nsDragAndDrop = {
 
   _mDS: null,
   get mDragService() {
-      if (!this._mDS) {
-          const kDSContractID = "@mozilla.org/widget/dragservice;1";
-          const kDSIID = Ci.nsIDragService;
-          this._mDS = Cc[kDSContractID].getService(kDSIID);
-        }
-      return this._mDS;
-    },
+    if (!this._mDS) {
+        const kDSContractID = "@mozilla.org/widget/dragservice;1";
+        const kDSIID = Ci.nsIDragService;
+      this._mDS = Cc[kDSContractID].getService(kDSIID);
+    }
+    return this._mDS;
+  },
 
   /**
    * void startDrag (DOMEvent aEvent, Object aDragDropObserver) ;
    *
    * called when a drag on an element is started.
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by the drag init
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    **/
   startDrag(aEvent, aDragDropObserver) {
-      if (!("onDragStart" in aDragDropObserver))
-        return;
+    if (!("onDragStart" in aDragDropObserver))
+      return;
+
+    const kDSIID = Ci.nsIDragService;
+    var dragAction = { action: kDSIID.DRAGDROP_ACTION_COPY + kDSIID.DRAGDROP_ACTION_MOVE + kDSIID.DRAGDROP_ACTION_LINK };
 
-      const kDSIID = Ci.nsIDragService;
-      var dragAction = { action: kDSIID.DRAGDROP_ACTION_COPY + kDSIID.DRAGDROP_ACTION_MOVE + kDSIID.DRAGDROP_ACTION_LINK };
+    var transferData = { data: null };
+    try {
+      aDragDropObserver.onDragStart(aEvent, transferData, dragAction);
+    } catch (e) {
+      return;  // not a draggable item, bail!
+    }
 
-      var transferData = { data: null };
-      try {
-        aDragDropObserver.onDragStart(aEvent, transferData, dragAction);
-      } catch (e) {
-        return;  // not a draggable item, bail!
+    if (!transferData.data) return;
+    transferData = transferData.data;
+
+    var dt = aEvent.dataTransfer;
+    var count = 0;
+    do {
+      var tds = transferData._XferID == "TransferData"
+                                       ? transferData
+                                       : transferData.dataList[count];
+      for (var i = 0; i < tds.dataList.length; ++i) {
+        var currData = tds.dataList[i];
+        var currFlavour = currData.flavour.contentType;
+        var value = currData.supports;
+        if (value instanceof Ci.nsISupportsString)
+          value = value.toString();
+        dt.mozSetDataAt(currFlavour, value, count);
       }
 
-      if (!transferData.data) return;
-      transferData = transferData.data;
+      count++;
+    }
+    while (transferData._XferID == "TransferDataSet" &&
+           count < transferData.dataList.length);
 
-      var dt = aEvent.dataTransfer;
-      var count = 0;
-      do {
-        var tds = transferData._XferID == "TransferData"
-                                         ? transferData
-                                         : transferData.dataList[count];
-        for (var i = 0; i < tds.dataList.length; ++i) {
-          var currData = tds.dataList[i];
-          var currFlavour = currData.flavour.contentType;
-          var value = currData.supports;
-          if (value instanceof Ci.nsISupportsString)
-            value = value.toString();
-          dt.mozSetDataAt(currFlavour, value, count);
-        }
-
-        count++;
-      }
-      while (transferData._XferID == "TransferDataSet" &&
-             count < transferData.dataList.length);
-
-      dt.effectAllowed = "all";
-      // a drag targeted at a tree should instead use the treechildren so that
-      // the current selection is used as the drag feedback
-      dt.addElement(aEvent.originalTarget.localName == "treechildren" ?
-                    aEvent.originalTarget : aEvent.target);
-      aEvent.stopPropagation();
-    },
+    dt.effectAllowed = "all";
+    // a drag targeted at a tree should instead use the treechildren so that
+    // the current selection is used as the drag feedback
+    dt.addElement(aEvent.originalTarget.localName == "treechildren" ?
+                  aEvent.originalTarget : aEvent.target);
+    aEvent.stopPropagation();
+  },
 
   /**
    * void dragOver (DOMEvent aEvent, Object aDragDropObserver) ;
    *
    * called when a drag passes over this element
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by passing over the element
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    **/
   dragOver(aEvent, aDragDropObserver) {
-      if (!("onDragOver" in aDragDropObserver))
-        return;
-      if (!this.checkCanDrop(aEvent, aDragDropObserver))
-        return;
-      var flavourSet = aDragDropObserver.getSupportedFlavours();
-      for (var flavour in flavourSet.flavourTable) {
-          if (this.mDragSession.isDataFlavorSupported(flavour)) {
-              aDragDropObserver.onDragOver(aEvent,
-                                           flavourSet.flavourTable[flavour],
-                                           this.mDragSession);
-              aEvent.stopPropagation();
-              aEvent.preventDefault();
-              break;
-            }
-        }
-    },
+    if (!("onDragOver" in aDragDropObserver))
+      return;
+    if (!this.checkCanDrop(aEvent, aDragDropObserver))
+      return;
+    var flavourSet = aDragDropObserver.getSupportedFlavours();
+    for (var flavour in flavourSet.flavourTable) {
+      if (this.mDragSession.isDataFlavorSupported(flavour)) {
+        aDragDropObserver.onDragOver(aEvent,
+                                     flavourSet.flavourTable[flavour],
+                                     this.mDragSession);
+        aEvent.stopPropagation();
+        aEvent.preventDefault();
+        break;
+      }
+    }
+  },
 
   mDragSession: null,
 
   /**
    * void drop (DOMEvent aEvent, Object aDragDropObserver) ;
    *
    * called when the user drops on the element
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by the drop
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    **/
   drop(aEvent, aDragDropObserver) {
-      if (!("onDrop" in aDragDropObserver))
-        return;
-      if (!this.checkCanDrop(aEvent, aDragDropObserver))
-        return;
+    if (!("onDrop" in aDragDropObserver))
+      return;
+    if (!this.checkCanDrop(aEvent, aDragDropObserver))
+      return;
 
-      var flavourSet = aDragDropObserver.getSupportedFlavours();
+    var flavourSet = aDragDropObserver.getSupportedFlavours();
 
-      var dt = aEvent.dataTransfer;
-      var dataArray = [];
-      var count = dt.mozItemCount;
-      for (var i = 0; i < count; ++i) {
-        var types = Array.from(dt.mozTypesAt(i));
-        for (var j = 0; j < flavourSet.flavours.length; j++) {
-          var type = flavourSet.flavours[j].contentType;
-          // dataTransfer uses text/plain but older code used text/unicode, so
-          // switch this for compatibility
-          var modtype = (type == "text/unicode") ? "text/plain" : type;
-          if (types.includes(modtype)) {
-            var data = dt.mozGetDataAt(modtype, i);
-            if (data) {
-              // Non-strings need some non-zero value used for their data length.
-              const kNonStringDataLength = 4;
+    var dt = aEvent.dataTransfer;
+    var dataArray = [];
+    var count = dt.mozItemCount;
+    for (var i = 0; i < count; ++i) {
+      var types = Array.from(dt.mozTypesAt(i));
+      for (var j = 0; j < flavourSet.flavours.length; j++) {
+        var type = flavourSet.flavours[j].contentType;
+        // dataTransfer uses text/plain but older code used text/unicode, so
+        // switch this for compatibility
+        var modtype = (type == "text/unicode") ? "text/plain" : type;
+        if (types.includes(modtype)) {
+          var data = dt.mozGetDataAt(modtype, i);
+          if (data) {
+            // Non-strings need some non-zero value used for their data length.
+            const kNonStringDataLength = 4;
 
-              var length = (typeof data == "string") ? data.length : kNonStringDataLength;
-              dataArray[i] = FlavourToXfer(data, length, flavourSet.flavourTable[type]);
-              break;
-            }
+            var length = (typeof data == "string") ? data.length : kNonStringDataLength;
+            dataArray[i] = FlavourToXfer(data, length, flavourSet.flavourTable[type]);
+            break;
           }
         }
       }
+    }
 
-      var transferData = new TransferDataSet(dataArray);
+    var transferData = new TransferDataSet(dataArray);
 
-      // hand over to the client to respond to dropped data
-      var multiple = "canHandleMultipleItems" in aDragDropObserver && aDragDropObserver.canHandleMultipleItems;
-      var dropData = multiple ? transferData : transferData.first.first;
-      aDragDropObserver.onDrop(aEvent, dropData, this.mDragSession);
-      aEvent.stopPropagation();
-    },
+    // hand over to the client to respond to dropped data
+    var multiple = "canHandleMultipleItems" in aDragDropObserver && aDragDropObserver.canHandleMultipleItems;
+    var dropData = multiple ? transferData : transferData.first.first;
+    aDragDropObserver.onDrop(aEvent, dropData, this.mDragSession);
+    aEvent.stopPropagation();
+  },
 
   /**
    * void dragExit (DOMEvent aEvent, Object aDragDropObserver) ;
    *
    * called when a drag leaves this element
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by leaving the element
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    **/
   dragExit(aEvent, aDragDropObserver) {
-      if (!this.checkCanDrop(aEvent, aDragDropObserver))
-        return;
-      if ("onDragExit" in aDragDropObserver)
-        aDragDropObserver.onDragExit(aEvent, this.mDragSession);
-    },
+    if (!this.checkCanDrop(aEvent, aDragDropObserver))
+      return;
+    if ("onDragExit" in aDragDropObserver)
+      aDragDropObserver.onDragExit(aEvent, this.mDragSession);
+  },
 
   /**
    * void dragEnter (DOMEvent aEvent, Object aDragDropObserver) ;
    *
    * called when a drag enters in this element
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by entering in the element
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    **/
   dragEnter(aEvent, aDragDropObserver) {
-      if (!this.checkCanDrop(aEvent, aDragDropObserver))
-        return;
-      if ("onDragEnter" in aDragDropObserver)
-        aDragDropObserver.onDragEnter(aEvent, this.mDragSession);
-    },
+    if (!this.checkCanDrop(aEvent, aDragDropObserver))
+      return;
+    if ("onDragEnter" in aDragDropObserver)
+      aDragDropObserver.onDragEnter(aEvent, this.mDragSession);
+  },
 
   /**
    * Boolean checkCanDrop (DOMEvent aEvent, Object aDragDropObserver) ;
    *
    * Sets the canDrop attribute for the drag session.
    * returns false if there is no current drag session.
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by the drop
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    **/
   checkCanDrop(aEvent, aDragDropObserver) {
-      if (!this.mDragSession)
-        this.mDragSession = this.mDragService.getCurrentSession();
-      if (!this.mDragSession)
-        return false;
-      this.mDragSession.canDrop = this.mDragSession.sourceNode != aEvent.target;
-      if ("canDrop" in aDragDropObserver)
-        this.mDragSession.canDrop &= aDragDropObserver.canDrop(aEvent, this.mDragSession);
-      return true;
-    },
+    if (!this.mDragSession)
+      this.mDragSession = this.mDragService.getCurrentSession();
+    if (!this.mDragSession)
+      return false;
+    this.mDragSession.canDrop = this.mDragSession.sourceNode != aEvent.target;
+    if ("canDrop" in aDragDropObserver)
+      this.mDragSession.canDrop &= aDragDropObserver.canDrop(aEvent, this.mDragSession);
+    return true;
+  },
 
   /**
    * Do a security check for drag n' drop. Make sure the source document
    * can load the dragged link.
    *
    * @param DOMEvent aEvent
    *        the DOM event fired by leaving the element
    * @param Object aDragDropObserver
    *        javascript object of format described above that specifies
    *        the way in which the element responds to drag events.
    * @param String aDraggedText
    *        the text being dragged
    **/
   dragDropSecurityCheck(aEvent, aDragSession, aDraggedText) {
-      // Strip leading and trailing whitespace, then try to create a
-      // URI from the dropped string. If that succeeds, we're
-      // dropping a URI and we need to do a security check to make
-      // sure the source document can load the dropped URI. We don't
-      // so much care about creating the real URI here
-      // (i.e. encoding differences etc don't matter), we just want
-      // to know if aDraggedText really is a URI.
+    // Strip leading and trailing whitespace, then try to create a
+    // URI from the dropped string. If that succeeds, we're
+    // dropping a URI and we need to do a security check to make
+    // sure the source document can load the dropped URI. We don't
+    // so much care about creating the real URI here
+    // (i.e. encoding differences etc don't matter), we just want
+    // to know if aDraggedText really is a URI.
 
-      aDraggedText = aDraggedText.replace(/^\s*|\s*$/g, "");
+    aDraggedText = aDraggedText.replace(/^\s*|\s*$/g, "");
 
-      var uri;
-      try {
-        uri = Services.io.newURI(aDraggedText);
-      } catch (e) {
-      }
+    var uri;
+    try {
+      uri = Services.io.newURI(aDraggedText);
+    } catch (e) {
+    }
 
-      if (!uri)
-        return;
+    if (!uri)
+      return;
 
-      // aDraggedText is a URI, do the security check.
-      const nsIScriptSecurityManager = Ci.nsIScriptSecurityManager;
-      var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
-                     .getService(nsIScriptSecurityManager);
+    // aDraggedText is a URI, do the security check.
+    const nsIScriptSecurityManager = Ci.nsIScriptSecurityManager;
+    var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
+                   .getService(nsIScriptSecurityManager);
 
-      if (!aDragSession)
-        aDragSession = this.mDragService.getCurrentSession();
+    if (!aDragSession)
+      aDragSession = this.mDragService.getCurrentSession();
 
-      var sourceDoc = aDragSession.sourceDocument;
-      // Use "file:///" as the default sourceURI so that drops of file:// URIs
-      // are always allowed.
-      var principal = sourceDoc ? sourceDoc.nodePrincipal
-                                : secMan.createCodebasePrincipal(Services.io.newURI("file:///"), {});
+    var sourceDoc = aDragSession.sourceDocument;
+    // Use "file:///" as the default sourceURI so that drops of file:// URIs
+    // are always allowed.
+    var principal = sourceDoc ? sourceDoc.nodePrincipal
+                              : secMan.createCodebasePrincipal(Services.io.newURI("file:///"), {});
 
-      try {
-        secMan.checkLoadURIStrWithPrincipal(principal, aDraggedText,
-                                            nsIScriptSecurityManager.STANDARD);
-      } catch (e) {
-        // Stop event propagation right here.
-        aEvent.stopPropagation();
+    try {
+      secMan.checkLoadURIStrWithPrincipal(principal, aDraggedText,
+                                          nsIScriptSecurityManager.STANDARD);
+    } catch (e) {
+      // Stop event propagation right here.
+      aEvent.stopPropagation();
 
-        throw "Drop of " + aDraggedText + " denied.";
-      }
-    },
+      throw "Drop of " + aDraggedText + " denied.";
+    }
+  },
 };
-