Bug 635542 - [Regression] Navigation buttons not updated when using URL fragments [r=mbrubeck]
authorMark Finkle <mfinkle@mozilla.com>
Sun, 20 Feb 2011 01:52:00 -0500
changeset 2813 ef94447b908edc08711fdbf940719fa1fc4baebd
parent 2812 e682232b0dbbecb3028528f1b5352cf51995e4c4
child 2814 e230a8add7660ef2f14576bbfdaf039394801a17
push id2363
push usermfinkle@mozilla.com
push dateSun, 20 Feb 2011 06:52:31 +0000
reviewersmbrubeck
bugs635542
Bug 635542 - [Regression] Navigation buttons not updated when using URL fragments [r=mbrubeck]
chrome/content/browser.js
--- a/chrome/content/browser.js
+++ b/chrome/content/browser.js
@@ -1305,17 +1305,17 @@ Browser.WebProgress.prototype = {
         break;
       }
 
       case "Content:LocationChange": {
         let spec = json.location;
         let location = spec.split("#")[0]; // Ignore fragment identifier changes.
 
         if (tab == Browser.selectedTab)
-          BrowserUI.updateURI({ captionOnly: true }); // Do less for more speed
+          BrowserUI.updateURI();
 
         let locationHasChanged = (location != tab.browser.lastLocation);
         if (locationHasChanged) {
           Browser.getNotificationBox(tab.browser).removeTransientNotifications();
           tab.resetZoomLevel();
           tab.hostChanged = true;
           tab.browser.lastLocation = location;
           tab.browser.userTypedValue = "";
@@ -1367,21 +1367,18 @@ Browser.WebProgress.prototype = {
       if (aTab.browser.currentURI.spec == "about:blank")
         BrowserUI.updateURI({ captionOnly: true });
     }
   },
 
   _networkStop: function _networkStop(aTab) {
     aTab.endLoading();
 
-    if (aTab == Browser.selectedTab) {
-      // Now that pageload is finished, do the more expensive updates
-      BrowserUI.updateURI();
+    if (aTab == Browser.selectedTab)
       BrowserUI.update(TOOLBARSTATE_LOADED);
-    }
 
     if (aTab.browser.currentURI.spec != "about:blank")
       aTab.updateThumbnail();
   },
 
   _documentStop: function _documentStop(aTab) {
     // Make sure the URLbar is in view. If this were the selected tab,
     // onLocationChange would scroll to top.
@@ -2568,16 +2565,19 @@ Tab.prototype = {
   },
 
   /** Record the initial zoom level when a page first loads. */
   resetZoomLevel: function resetZoomLevel() {
     this._defaultZoomLevel = this._browser.scale;
   },
 
   scrolledAreaChanged: function scrolledAreaChanged() {
+    if (!this._browser)
+      return;
+
     this.updateDefaultZoomLevel();
 
     if (!this.useFallbackWidth && this._browser.contentDocumentWidth > kDefaultBrowserWidth)
       this.useFallbackWidth = true;
 
     this.updateViewportSize();
   },