Bug 564100 No way to tell if a non-current tab has been read: [selected=false] is not possible anymore r=Neil.
authorTony Mechelynck <antoine.mechelynck@gmail.com>
Fri, 16 Sep 2011 16:23:36 +0800
changeset 8501 d31c11953f75049ca10a52b93e40016b1f7448f4
parent 8500 5298d97973c4e16a5b80261278c39b055fb2344e
child 8502 69c4e650e7b52a985969318a7766413f2b0c19a9
push id6526
push userphilip.chee@gmail.com
push dateFri, 16 Sep 2011 08:26:26 +0000
treeherdercomm-central@d31c11953f75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil
bugs564100
Bug 564100 No way to tell if a non-current tab has been read: [selected=false] is not possible anymore r=Neil.
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;
@@ -1046,16 +1048,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,