Bug 787475 - Prevent threadpane selection/messagepane content mismatches on folder/tab switches. r=mconley
authoralta88 <alta88@gmail.com>
Sun, 02 Sep 2012 11:58:53 -0600
changeset 12253 29d6d9143faddc9865705b99bdc87e199a1b5d26
parent 12252 1bdd4637a53c42c72a0b54519f9d3257ad20f8d2
child 12254 9eda601390551ba4f8751b3857faf9209c691e83
push id738
push userbugzilla@standard8.plus.com
push dateMon, 08 Oct 2012 19:38:39 +0000
treeherdercomm-aurora@6694e4ec3767 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs787475
Bug 787475 - Prevent threadpane selection/messagepane content mismatches on folder/tab switches. r=mconley
mail/base/content/folderDisplay.js
--- a/mail/base/content/folderDisplay.js
+++ b/mail/base/content/folderDisplay.js
@@ -1264,16 +1264,22 @@ FolderDisplayWidget.prototype = {
    * @param aFolder The display/view folder, as opposed to the backing folder.
    * @param aSubject The subject with "Re: " if it's got one, which makes it
    *     notably different from just directly accessing the message header's
    *     subject.
    * @param aKeywords The keywords, which roughly translates to message tags.
    */
   displayMessageChanged: function FolderDisplayWidget_displayMessageChanged(
       aFolder, aSubject, aKeywords) {
+    // Hide previous stale message to prevent brief threadpane selection and
+    // content displayed mismatch, on both folder and tab changes.
+    let browser = getBrowser();
+    if (browser && browser.contentDocument && browser.contentDocument.body)
+      browser.contentDocument.body.hidden = true;
+
     UpdateMailToolbar("FolderDisplayWidget displayed message changed");
     let viewIndex = this.view.dbView.currentlyDisplayedMessage;
     let msgHdr = (viewIndex != nsMsgViewIndex_None) ?
                    this.view.dbView.getMsgHdrAt(viewIndex) : null;
     this.messageDisplay.onDisplayingMessage(msgHdr);
 
     // Although deletes should now be so fast that the user has no time to do
     //  anything, treat the user explicitly choosing to display a different