Bug 564100 No way to tell if a non-current tab has been read: [selected=false] is not possible anymore r=Neil a=Callek for comm-aurora/comm-beta.
authorTony Mechelynck <antoine.mechelynck@gmail.com>
Fri, 16 Sep 2011 16:23:36 +0800
changeset 8823 2c654b93aaa12ba5a63574c970e0b4d6687b1ebd
parent 8822 5827d8225ac45e4941b9564ccef51af03b9e379a
child 8824 b1fa151ad16953a1dbbd29c0310b7b0d4245dbeb
push idunknown
push userunknown
push dateunknown
reviewersNeil, Callek
bugs564100
Bug 564100 No way to tell if a non-current tab has been read: [selected=false] is not possible anymore r=Neil a=Callek for comm-aurora/comm-beta.
suite/browser/tabbrowser.xml
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -504,16 +504,18 @@
                     this.mBrowser.userTypedClear -= 2;
                   else if (this.mBrowser.userTypedClear > 0)
                     this.mBrowser.userTypedClear--;
 
                 if (this.mBlank)
                   this.mBlank = false;
 
                 this.mTab.removeAttribute("busy");
+                if (!this.mTab.selected)
+                  this.mTab.setAttribute("unread", "true");
 
                 var location = this.mBrowser.currentURI;
                 if (this.mBrowser.mIconURL) {
                   this.mTab.setAttribute("image", this.mBrowser.mIconURL);
                 }
                 else if (this.mBrowser.contentDocument instanceof ImageDocument &&
                          this.mTabBrowser.mPrefs.getBoolPref("browser.chrome.site_icons")) {
                   var req = this.mBrowser.contentDocument.imageRequest;
@@ -1045,16 +1047,17 @@
               this.mCurrentBrowser.setAttribute("type", "content-targetable");
               this.mCurrentBrowser.docShell.isActive = false;
             }
 
             newBrowser.setAttribute("type", "content-primary");
             newBrowser.docShell.isActive = true;
             this.mCurrentBrowser = newBrowser;
             this.mCurrentTab = this.selectedTab;
+            this.mCurrentTab.removeAttribute("unread");
             var tabListener = this.mTabListeners[this.tabContainer.selectedIndex];
 
             // Update the URL bar.
             this.updateUrlBar(newBrowser.webProgress,
                               null,
                               newBrowser.currentURI,
                               newBrowser.securityUI,
                               newBrowser,