Bug 1363671 - Making the window attribute 'iconLoadingPrincipal' been set before than window attributes 'image' during favicon loading. r?ckerschb draft
authorTim Huang <tihuang@mozilla.com>
Thu, 18 May 2017 21:09:08 +0800
changeset 582385 edf7cef71309f124107e0838bebce03ee405d009
parent 580040 baf05f61bc14fdf45511bc1165ce76daa08c5c0f
child 629755 2e0e84f463717111242b750f6e00fa7c30deb9af
push id60065
push userbmo:tihuang@mozilla.com
push dateMon, 22 May 2017 12:42:34 +0000
reviewersckerschb
bugs1363671
milestone55.0a1
Bug 1363671 - Making the window attribute 'iconLoadingPrincipal' been set before than window attributes 'image' during favicon loading. r?ckerschb Setting window attribute 'iconLoadingPrincipal' before window attribute 'image' which allows using the right principal for favicon loads and prevents intermittent timing issues. MozReview-Commit-ID: J4GM6CMG26O
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -905,27 +905,27 @@
                 aURI = makeURI(aURI);
               }
               PlacesUIUtils.loadFavicon(browser, loadingPrincipal, aURI);
             }
 
             let sizedIconUrl = browser.mIconURL || "";
             if (sizedIconUrl != aTab.getAttribute("image")) {
               if (sizedIconUrl) {
-                aTab.setAttribute("image", sizedIconUrl);
                 if (!browser.mIconLoadingPrincipal ||
                     !browser.mIconLoadingPrincipal.equals(loadingPrincipal)) {
                   aTab.setAttribute("iconLoadingPrincipal",
                     this.serializationHelper.serializeToString(loadingPrincipal));
                   browser.mIconLoadingPrincipal = loadingPrincipal;
                 }
+                aTab.setAttribute("image", sizedIconUrl);
               } else {
-                aTab.removeAttribute("image");
                 aTab.removeAttribute("iconLoadingPrincipal");
                 delete browser.mIconLoadingPrincipal;
+                aTab.removeAttribute("image");
               }
               this._tabAttrModified(aTab, ["image"]);
             }
 
             this._callProgressListeners(browser, "onLinkIconAvailable", [browser.mIconURL]);
           ]]>
         </body>
       </method>