Bug 681944 - Immediately remove "empty" attribute from session-restored tabs (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Wed, 28 Sep 2011 17:56:53 +0100
changeset 77773 f3022823eb876895edb22eb8aaca29fa3787ad42
parent 77772 b626aecfddf79d6d3333b19f625f3d6514d5b602
child 77774 9cd3dc884d1c296656e5b07192e7c3143a5250c7
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmfinkle
bugs681944
milestone10.0a1
Bug 681944 - Immediately remove "empty" attribute from session-restored tabs (r=mfinkle) Otherwise user will not be able to restore a closed tab if he closes it before the session-restored thumbnail is loaded.
mobile/components/SessionStore.js
--- a/mobile/components/SessionStore.js
+++ b/mobile/components/SessionStore.js
@@ -782,22 +782,22 @@ SessionStore.prototype = {
             tab.browser.__SS_restore = true;
 
             // Restore current title
             tab.chromeTab.updateTitle(tabData.entries[tabData.index - 1].title);
 
             // Recreate the thumbnail if we are delay loading the tab
             let canvas = tab.chromeTab.thumbnail;
             canvas.setAttribute("restored", "true");
+            canvas.removeAttribute("empty");
   
             let image = new window.Image();
             image.onload = function() {
               if (canvas) {
                 canvas.getContext("2d").drawImage(image, 0, 0);
-                canvas.removeAttribute("empty");
               }
             };
             image.src = tabData.extData.thumbnail;
           }
 
           tab.browser.__SS_extdata = tabData.extData;
         }