Bug 714230 - Unsuppress drawing for background tabs when they're shown. r=kats
authorPatrick Walton <pwalton@mozilla.com>
Fri, 30 Dec 2011 14:04:47 -0800
changeset 83593 f2610136fb54094038a312f6d92ba4f5a428fdb5
parent 83592 9dda4ea46da1821c8259eadf279549b90354cdca
child 83594 d4c526ba534353396ea1d12c49b5c60b67f8a56e
push idunknown
push userunknown
push dateunknown
reviewerskats
bugs714230
milestone12.0a1
Bug 714230 - Unsuppress drawing for background tabs when they're shown. r=kats
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -768,20 +768,19 @@ var BrowserApp = {
     } else if (aTopic == "FullScreen:Exit") {
       browser.contentDocument.mozCancelFullScreen();
     } else if (aTopic == "Viewport:Change") {
       this.selectedTab.viewport = JSON.parse(aData);
       ViewportHandler.onResize();
     } else if (aTopic == "SearchEngines:Get") {
       this.getSearchEngines();
     } else if (aTopic == "document-shown") {
-      let tab = this.selectedTab;
-      if (tab.browser.contentDocument != aSubject) {
+      let tab = BrowserApp.getTabForBrowser(BrowserApp.getBrowserForDocument(aSubject));
+      if (!tab)
         return;
-      }
 
       ViewportHandler.resetMetadata(tab);
 
       // Unsuppress drawing unless the page was being thawed from the bfcache (which is an atomic
       // operation, so there is no drawing to suppress).
       if (tab.suppressDrawing) {
         tab.sendExposeEvent();
         tab.suppressDrawing = false;