Bug 1186077 - Default favicon (globe) is briefly shown on about:home before updating to favicon. r=mcomella
authorSergej Kravcenko <sergej@codewaves.com>
Tue, 15 Sep 2015 17:28:37 -0700
changeset 295247 8d3e78909a643f9a31dd03cdae4a40984591b7e0
parent 295246 105633f695fae3769f9c72832c8b1d19a5941c97
child 295248 f1ffe36425983f65d06e1de1378c7347147373b3
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcomella
bugs1186077
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1186077 - Default favicon (globe) is briefly shown on about:home before updating to favicon. r=mcomella
mobile/android/base/Tab.java
mobile/android/base/Tabs.java
--- a/mobile/android/base/Tab.java
+++ b/mobile/android/base/Tab.java
@@ -419,16 +419,21 @@ public class Tab {
 
         // Add this Favicon to the set of available Favicons.
         synchronized (mAvailableFavicons) {
             mAvailableFavicons.add(favicon);
         }
     }
 
     public void loadFavicon() {
+        // Static Favicons never change
+        if (AboutPages.isBuiltinIconPage(mUrl) && mFavicon != null) {
+            return;
+        }
+
         // If we have a Favicon explicitly set, load it.
         if (!mAvailableFavicons.isEmpty()) {
             RemoteFavicon newFavicon = mAvailableFavicons.first();
 
             // If the new Favicon is different, cancel the old load. Else, abort.
             if (newFavicon.faviconUrl.equals(mFaviconUrl)) {
                 return;
             }
@@ -662,16 +667,22 @@ public class Tab {
             updateBookmark();
             updateReadingList();
             if (!sameDocument) {
                 // We can unconditionally clear the favicon and title here: we
                 // already filtered both cases in which this was a (pseudo-)
                 // spurious location change, so we're definitely loading a new
                 // page.
                 clearFavicon();
+
+                // Load local static Favicons immediately
+                if (AboutPages.isBuiltinIconPage(uri)) {
+                    loadFavicon();
+                }
+
                 updateTitle(null);
             }
         }
 
         if (sameDocument) {
             // We can get a location change event for the same document with an anchor tag
             // Notify listeners so that buttons like back or forward will update themselves
             Tabs.getInstance().notifyListeners(this, Tabs.TabEvents.LOCATION_CHANGE, oldUrl);
--- a/mobile/android/base/Tabs.java
+++ b/mobile/android/base/Tabs.java
@@ -919,20 +919,18 @@ public class Tabs implements GeckoEventL
         if (tabToSelect == null) {
             return null;
         }
 
         if (!delayLoad && !background) {
             selectTab(tabToSelect.getId());
         }
 
-        // TODO: surely we could just fetch *any* cached icon?
+        // Load favicon instantly for about:home page because it's already cached
         if (AboutPages.isBuiltinIconPage(url)) {
-            Log.d(LOGTAG, "Setting about: tab favicon inline.");
-            tabToSelect.addFavicon(url, Favicons.browserToolbarFaviconSize, "");
             tabToSelect.loadFavicon();
         }
 
         return tabToSelect;
     }
 
     public Tab addTab() {
         return loadUrl(AboutPages.HOME, Tabs.LOADURL_NEW_TAB);