Closed Bug 1069971 Opened 10 years ago Closed 8 years ago

Don't paint ugly box around home screen shortcut icons if icon has high resolution

Categories

(Firefox for Android Graveyard :: General, defect)

ARM
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: max.schulze, Unassigned, Mentored)

Details

(Keywords: polish, testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:32.0) Gecko/20100101 Firefox/32.0
Build ID: 20140830210550

Steps to reproduce:

open a site in firefox
add to bookmarks
go to bookmark's settings
select 'add on homescreen'

(site has something like:)

<link rel="icon" sizes="114x114" href="touch-icon114.png" />
<link rel="icon" sizes="144x144" href="touch-icon144.png" />
<link rel="icon" sizes="152x152" href="touch-icon152.png" />



Actual results:

firefox will fetch the best resolution icon but will paint an ugly box around it for android home screen


Expected results:

paint the icon as-it-is, as you would do for shortcuts for webapps

(like chrome does!)
Severity: normal → major
Severity: major → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → Android
Hardware: x86_64 → ARM
Version: Firefox 32 → Trunk
Same issue here (see attachement).

But there is no box added, just an ugly icon.

My website serves icons in 10 different (square) sizes from 16x16 to 152x152 with such code:

<link rel="icon" sizes="16x16" href="icon-16.png" />

With both Firefox for Android, and Chrome, the 152x152 is downloaded (actually, Chrome also downloads the penultimate one (144)).

My tablet has a 7" 1024x600 display, icons are ~60 pixels wide.

This may not be the best place to ask this, but why is the biggest icon downloaded? I thought that the purpose of serving the icon in several sizes was to allow the browser to download the more suitable one and avoid icons that do not scale well.
We ask Android what the launcher icon size is and try to use that one:

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoAppShell.java#859

Unfortunately, the bookmarks panel doesn't go through that path:

http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/home/HomeFragment.java#198

We should fix that :) Will toss up a patch, but a url to your page would help test it.
Hmm.. Actually I was wrong. Looks like getPreferredSizeFaviconForPage will actually use the launcher size (these methods aren't named well). I wonder if our favicons code is messing up somewhere... Will dig a bit more (but the test page would still help).
Sure, I've setup a test case here:
http://sigill.github.io/mozilla_bug_1069971/
Keywords: testcase
Possible workaround: To add the bookmark to your home screen, use New Tab > Bookmarks > long press on desired bookmark > Add to Home Screen.

It worked on the one bookmark I tried.
Maybe this can be mentored?
Keywords: polish
The logic for these icons has changed, I don't think this is valid anymore.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: