Bug 547731 - browser-ui.js#159 tab is null error [r=mark.finkle]
authorVivien Nicolas <21@vingtetun.org>
Thu, 04 Mar 2010 15:12:15 -0500
changeset 66036 36cbcff6335a596a15fd9ad094a38e618b366cf0
parent 66035 2410b8b816fdc832234c7a010cd7b09741a5a621
child 66037 61c2f0624cb13e9288baf567ecf8b5df826418f4
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)
reviewersmark
bugs547731
Bug 547731 - browser-ui.js#159 tab is null error [r=mark.finkle]
mobile/chrome/content/browser-ui.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -146,18 +146,19 @@ var BrowserUI = {
   },
 
   _linkAdded : function(aEvent) {
     let link = aEvent.originalTarget;
     if (!link || !link.href)
       return;
 
     if (/\bicon\b/i(link.rel)) {
+      // Must have an owner document and not be in a frame
       var ownerDoc = link.ownerDocument;
-      if (!ownerDoc) // no document, no icon
+      if (!ownerDoc || ownerDoc.defaultView.frameElement)
         return;
 
       let tab = Browser.getTabForDocument(ownerDoc);
       tab.setIcon(link.href);
       // If the link changes after pageloading, update it right away.
       // otherwise we wait until the pageload finishes
       if ((tab.browser == Browser.selectedBrowser) && !tab.isLoading())
         this._updateIcon(tab.browser.mIconURL);