Closed Bug 600645 Opened 14 years ago Closed 14 years ago

App tabs don't appear in the group app tab tray if their icon fails to load

Categories

(Firefox Graveyard :: Panorama, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED
Firefox 4.0b8

People

(Reporter: iangilman, Assigned: raymondlee)

References

Details

Attachments

(1 file, 5 obsolete files)

We have a default icon we use if the app tab has no icon, but if it lists an icon that's broken, we use that and consequently the app tab doesn't show up at all.

I found this making one of my own pages an app tab: 

http://iangilman.com/germany/

... which gives a favicon link of:

http://iangilman.com/favicon.ico

... even though it's not actually listed anywhere on the page; must be Firefox making assumptions?

Obviously I can fix it by fixing my page, but presumably this is an issue for other pages as well. 

So, on the one hand, I don't know that people will be picking favicon-less pages to make into app tabs, but on the other hand, if they do it kind of looks like data loss.
Blocks: 598154
Assignee: nobody → raymond
Status: NEW → ASSIGNED
Attached patch v1 (obsolete) — Splinter Review
Attachment #488824 - Flags: feedback?(ian)
Blocks: 610242
Comment on attachment 488824 [details] [diff] [review]
v1

>   addAppTab: function GroupItem_addAppTab(xulTab) {
>     let self = this;
> 
>+    xulTab.addEventListener("error", this._onAppTabError, false);

Is a failed favIcon the only thing that triggers a xul:tab error event? I would imagine not... how do we detect the specific error we're interested in?

>                  search1.html \
>                  search2.html \
>+                 browser_tabview_bug600645.html \

I believe a file, even an html file, prefixed with "browser" will be run as a test. Please remove "browser_tabview_" from the html file's name.

>+<link reL="shortcut icon" href="favicon.ico">

Nit: reL should be rel.

>+  let errorHandler = function(event) {
>+    newTab.removeEventListener("error", errorHandler, false);
>+
>+    // clean up
>+    gBrowser.removeTab(newTab);
>+    let endGame = function() {
>+      window.removeEventListener("tabviewhidden", endGame, false);
>+
>+      ok(!TabView.isVisible(), "Tab View is hidden");
>+      finish();
>+    }
>+    window.addEventListener("tabviewhidden", endGame, false);
>+    TabView.toggle();
>+  };
>+  newTab.addEventListener("error", errorHandler, false);
>+
>+  newTab.linkedBrowser.loadURI(
>+    "http://mochi.test:8888/browser/browser/base/content/test/tabview/browser_tabview_bug600645.html");

You're testing that the error is fired from the xul:tab, but you still need to test to see whether the app tabs respond correctly with their icon.
Attachment #488824 - Flags: feedback?(ian) → feedback-
Attached patch v1 (obsolete) — Splinter Review
(In reply to comment #2)
> Comment on attachment 488824 [details] [diff] [review]
> v1
> 
> >   addAppTab: function GroupItem_addAppTab(xulTab) {
> >     let self = this;
> > 
> >+    xulTab.addEventListener("error", this._onAppTabError, false);
> 
> Is a failed favIcon the only thing that triggers a xul:tab error event? I would
> imagine not... how do we detect the specific error we're interested in?

A failed favicon should be the only thing that triggers the error event.  See the below links, the code removes the image attribute (the fav icon src) when an error event occurs.
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#1123
http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#2558

> 
> >                  search1.html \
> >                  search2.html \
> >+                 browser_tabview_bug600645.html \
> 
> I believe a file, even an html file, prefixed with "browser" will be run as a
> test. Please remove "browser_tabview_" from the html file's name.

Changed the name to bug600645.html

> 
> >+<link reL="shortcut icon" href="favicon.ico">
> 
> Nit: reL should be rel.

Fixed

> 
> >+  let errorHandler = function(event) {
> >+    newTab.removeEventListener("error", errorHandler, false);
> >+
> >+    // clean up
> >+    gBrowser.removeTab(newTab);
> >+    let endGame = function() {
> >+      window.removeEventListener("tabviewhidden", endGame, false);
> >+
> >+      ok(!TabView.isVisible(), "Tab View is hidden");
> >+      finish();
> >+    }
> >+    window.addEventListener("tabviewhidden", endGame, false);
> >+    TabView.toggle();
> >+  };
> >+  newTab.addEventListener("error", errorHandler, false);
> >+
> >+  newTab.linkedBrowser.loadURI(
> >+    "http://mochi.test:8888/browser/browser/base/content/test/tabview/browser_tabview_bug600645.html");
> 
> You're testing that the error is fired from the xul:tab, but you still need to
> test to see whether the app tabs respond correctly with their icon.

Added extra code for that.
Attachment #488824 - Attachment is obsolete: true
Attachment #489110 - Flags: feedback?(ian)
Comment on attachment 489110 [details] [diff] [review]
v1

> A failed favicon should be the only thing that triggers the error event.  See
> the below links, the code removes the image attribute (the fav icon src) when
> an error event occurs.
> http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#1123
> http://mxr.mozilla.org/mozilla-central/source/browser/base/content/tabbrowser.xml#2558

Fair enough, thanks!

>+  // change the src to something else.
>+  let otherFavIconURL = "http://mochi.test:8888/fav.ico";
>+  $icon.attr("src", otherFavIconURL);
>+  is($icon.attr("src"), otherFavIconURL, "The icon src is using another fav icon");

I'm not sure what the purpose of this bit is; I'd leave it out. 

If it's to make sure we're not getting a false positive later on, it doesn't do any good, since as soon as you change the url of the app tab (with .linkedBrowser.loadURI), the icon src is changed to the new thing (at least once the TabAttrModified gets to it).

F+ otherwise.
Attachment #489110 - Flags: feedback?(ian) → feedback+
Attached patch v1 (obsolete) — Splinter Review
Updated the patch based on Ian's comment.

f=ian
Attachment #489110 - Attachment is obsolete: true
Attachment #489373 - Flags: review?(dao)
Attachment #489373 - Flags: review?(dao)
Attachment #489373 - Flags: review+
Attachment #489373 - Flags: approval2.0?
Sent it to try 0effc839caf3, waiting for the result
(In reply to comment #6)
> Sent it to try 0effc839caf3, waiting for the result

Passed Try
Comment on attachment 489373 [details] [diff] [review]
v1

a=beltzner
Attachment #489373 - Flags: approval2.0? → approval2.0+
Attached patch Patch for check-in (obsolete) — Splinter Review
Attachment #489373 - Attachment is obsolete: true
Attachment #492722 - Attachment is patch: true
Attachment #492722 - Attachment mime type: application/octet-stream → text/plain
Keywords: checkin-needed
Attached patch Patch for check-in (obsolete) — Splinter Review
Attachment #492722 - Attachment is obsolete: true
Attachment #492723 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/597e4c5ded14
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
This bug was part of a mass backout to fix the permanent leak on OS X 64 that this push caused.

http://hg.mozilla.org/mozilla-central/rev/b014423f755b
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Passed Try
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/cca91ee678e5
Status: REOPENED → RESOLVED
Closed: 14 years ago14 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 4.0b8
Verified in recent nightly minefield build
Status: RESOLVED → VERIFIED
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: