Bug 572992 - Wrong favicon displayed for a page opened in a new tab [r=mfinkle]
authorVivien Nicolas <21@vingtetun.org>
Mon, 21 Jun 2010 22:18:42 +0200
changeset 66302 13684cca16292dbeadf6b101c541209abc66f866
parent 66301 a00c3a60c136dd56dca773f316f20f1e561a0023
child 66303 b5aa12aaf59a5d282f56fddded1727d6c220368a
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs572992
Bug 572992 - Wrong favicon displayed for a page opened in a new tab [r=mfinkle]
mobile/chrome/content/bindings/browser.js
mobile/chrome/content/bindings/browser.xml
--- a/mobile/chrome/content/bindings/browser.js
+++ b/mobile/chrome/content/bindings/browser.js
@@ -271,17 +271,17 @@ let DOMEvents =  {
         break;
 
       case "DOMLinkAdded":
         let target = aEvent.originalTarget;
         if (!target.href || target.disabled)
           return;
 
         let json = {
-          location: document.documentURIObject.spec,
+          windowId: target.ownerDocument.defaultView.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils).currentInnerWindowID,
           href: target.href,
           charset: document.characterSet,
           title: target.title,
           rel: target.rel,
           type: target.type
         };
 
         sendSyncMessage("DOMLinkAdded", json);
--- a/mobile/chrome/content/bindings/browser.xml
+++ b/mobile/chrome/content/bindings/browser.xml
@@ -111,17 +111,18 @@
               break;
 
             case "DOMTitleChanged":
               this._contentTitle = aMessage.json.title;
               break;
 
             case "DOMLinkAdded":
               let link = aMessage.json;
-              if (link.location != this._documentURI)
+              // ignore results from subdocuments
+              if (link.windowId != this.contentWindowId)
                 return {};
 
               let linkType = this._getLinkType(link);
               switch(linkType) {
                 case "icon":
                   let iconURI = gIOService.newURI(link.href, link.charset, null);
                   if (!iconURI.schemeIs("javascript") && !gFaviconService.isFailedFavicon(iconURI)) {
                     gFaviconService.setAndLoadFaviconForPage(this.currentURI, iconURI, true);