Closed Bug 1772264 Opened 2 years ago Closed 28 days ago

Distinguish "rich" icons in the favicons service and when asking for a small sized icon prefer the classic ones

Categories

(Firefox :: Bookmarks & History, defect, P3)

Firefox 101
Unspecified
All
defect
Points:
3

Tracking

()

RESOLVED FIXED
132 Branch
Tracking Status
firefox-esr91 --- wontfix
firefox-esr102 --- wontfix
firefox101 --- wontfix
firefox102 --- wontfix
firefox103 --- wontfix
firefox132 --- fixed

People

(Reporter: rickmastfan67, Assigned: yazan)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [favicons-2024][sng])

User Story

Let's add a "flags" integer field to the moz_icons table, the first flag will be ICON_RICH (more flags could be added in the future, for excample for mask-icon or dark/light).
The info will be missing for already existing icons.
we'll then use this info in bug 1494016 (see bug 1494016 comment 7 there for some code hints).

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0

Steps to reproduce:

  1. Loaded the following page: https://www.nhl.com/penguins
  2. Notice in the 'tab', that the favicon is the Pittsburgh Penguins logo.
  3. Now, attempt to bookmark the website.
  4. Notice that you can see in the initial bookmark creation window, that it shows the Penguins logo.
  5. Save the bookmark (doesn't matter where, but save it in the Bookmark toolbar for easy access).

Actual results:

Once the bookmark is saved, the 'favicon' is that of the NHL's main website.

Expected results:

Once the bookmark is saved, the 'favicon' should be the Pittsburgh Penguins logo, as you can see in the tab for the website.

The Bugbug bot thinks this bug should belong to the 'Firefox::Bookmarks & History' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Bookmarks & History

Reproducible on Firefox 101 through Firefox 103.0a1 on Windows 10 and MacOS 11 as well.

Thank you for reporting!

Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Unspecified → All
Flags: needinfo?(mak)

The site is doing something particular here.
The icon shortcut points to the Penguins icon, that is a 256x256 png
Then it also provides apple-touch-icons in 57x57, 72x72, 114x114, 144x144 sizes, but those are generic nhl icons, not specific.

The tab just ignores apple-touch-icon entries, but the favicon service doesn't, it wants all the plausible icon sources, to do a better job at upscaling/downscaling. After all the service may have to provide an icon for the New Tab page or other similar UIs.
When we ask to the favicon service a 32px icon, it will try to find one close to the requested size, and it will return the 57x57 apple-touch-icon.

Now, this could be fixed on the site itself by providing a multi-resolution ico file or an svg in "shortcut icon", that would better adapt to multiple resolutions.

On our side, probably a solution would be to store whether an icon is "rich" or "classic", and when asking for common sized icons (16 to 64px) give priority to the classic ones, only use rich ones as fallback.

Severity: -- → S3
Flags: needinfo?(mak)
Priority: -- → P3
Summary: Bookmark doesn't use correct 'favicon' → Distinguish "rich" icons in the favicons service and when asking for a small sized icon prefer the classic ones
Duplicate of this bug: 1819308
See Also: → 1383758
Duplicate of this bug: 1837655
Blocks: 1494016
Duplicate of this bug: 1844577
Duplicate of this bug: 1799691
Duplicate of this bug: 1854871

This issue is reported many times.

The tab just ignores apple-touch-icon entries, but the favicon service doesn't

They should use the same icon, not do something different.

When we ask to the favicon service a 32px icon, it will try to find one close to the requested size, and it will return the 57x57 apple-touch-icon.

That is not a reasonable strategy. Suppose that a 36px icon is closest; resizing that one will probably give a lousy result. It would be better to use an icon that is a multiple of the requested one (64px, 128px) or an SVG icon.

Personally I would prefer the SVG always, if present, because it may contain a style sheet that adapts to dark mode, for instance. And, important, store the SVG and not a converted bitmap version, otherwise switching between light and dark mode still does not work.

(In reply to Ben from comment #9)

This issue is reported many times.

I'm not so sure if this bug will ever be fixed.

Again, the reason using apple-touch-icon as the first preference is a bad idea is that it's not even supposed to be used inside a browser. It's the icon when you drag a webpage to an Apple device's homepage. For example, when you drag mozilla.org to your iPhone homepage, it appears next to icons like "Settings" and "App Store". If you've ever used an Apple device, you would notice that such icons have a specific shape (they don't have corners). In fact, they also have specific colour requirements (Apple devices will autofill any apple-touch-icon transparency with black), that's why it's not supposed to be used anywhere else.

Blocks: 1494772
Whiteboard: [favicons-2024]
Whiteboard: [favicons-2024] → [favicons-2024][sng]
Points: --- → 3
User Story: (updated)
Assignee: nobody → yalmacki
Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/fc492653034f Part 1: Database schema change adding flags field to moz_icons table - r=mak https://hg.mozilla.org/integration/autoland/rev/0a79fdeabfd0 Part 2: Identifying a rich icon and passing down the info - r=mak https://hg.mozilla.org/integration/autoland/rev/bc9dcd2cf7c9 Part 3: Use rich info to filter icons returned - r=mak
Status: NEW → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Regressions: 1917470
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: