Closed Bug 1811128 Opened 2 years ago Closed 2 years ago

Lower quality icon is shown (scaled from 19 to 16) when "browser_action" lists both "16" and "19"

Categories

(WebExtensions :: Frontend, defect, P1)

Firefox 109
defect

Tracking

(firefox-esr102 unaffected, firefox109 wontfix, firefox110 wontfix, firefox111 verified)

VERIFIED FIXED
111 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox109 --- wontfix
firefox110 --- wontfix
firefox111 --- verified

People

(Reporter: extophf, Assigned: willdurand)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [addons-jira])

Attachments

(6 files)

Attached file extension.zip

Steps to reproduce:

  1. install an extension that specifies both "16" and "19" icons in its "browser_action"
  2. pin its icon using the Unified extensions UI

Actual results:

The icon is smudged because the image for 19px was scaled down to 16px.

Expected results:

The icon is clear and crisp when the image for 16px is used.

Regressed in 108: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=650b8a7c958514f3357acfb4a7342a5d14f58537&tochange=963d3b67f5243687fcb5bc122a22a536caa9a9fd

As to why this is a problem, it's because extension authors want to specify both "16" and "19" (as well as "32" and "38") to support various browser modifications that may use different icon sizes in their UI. Some browsers may even make it configurable by the user.

Hello,

I reproduced the issue on the latest Nightly (111.0a1/20230119163652), Beta (110.0b3/20230119185824) and Release (109.0/20230112150232) under Windows 10 x64 and Ubuntu 16.04 LTS.

Once the extension is pinned to the toolbar, the icon is indeed smudged. For further details, see the attached screenshot.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached image 2023-01-20_09h47_45.png

BTW the problem is not limited to just "19", but "32" is also problematic. It looks like Firefox now chooses the biggest icon regardless of the display's dpi. If you rename "19" to "32" in the attached extension's manifest.json you'll see Firefox incorrectly shows the "32" icon, whereas on a single-density display the correct choice is "16", just as it was previously.

I'm unable to reproduce this on my end. Could you run mozregression to see when this started happening?

Edit: Nevermind, I see the problem now.

The mozregression range is in comment 1.

Last good revision: f9bb8bffa11e11c730bcefc548ee3a374902f838
First bad revision: 31f51c0e8a5c8b320c02cd9772c51419e9474a2c

Regressed by: 1798324

The old code was using 16/32/16/32,
but the new code uses 16/32/32/64:

  • if (gUnifiedExtensionsEnabled) {
  •  return `
    
  •    ${getStyle("menupanel-image", icon16)}
    
  •    ${getStyle("menupanel-image-2x", icon32)}
    
  •    ${getStyle("toolbar-image", icon32)}
    
  •    ${getStyle("toolbar-image-2x", icon64)}
    
  •  `;
    
  • }
  • return ${getStyle("menupanel-image", icon16)} ${getStyle("menupanel-image-2x", icon32)} ${getStyle("toolbar-image", icon16)} ${getStyle("toolbar-image-2x", icon32)};

Set release status flags based on info from the regressing bug 1798324

:willdurand, since you are the author of the regressor, bug 1798324, could you take a look? Also, could you set the severity field?

For more information, please visit auto_nag documentation.

Flags: needinfo?(wdurand)
Keywords: regression

According to searchfox, we use 32/64px icons for both the toolbar and the menupanel. This is because we need "bigger" icons in the extensions panel.

Flags: needinfo?(wdurand)

Maybe srcset attribute could help. Regardless of the method, for a N-pixel single-density image the proper solution is to use a N-pixel source icon.

Assignee: nobody → wdurand
Attachment #9313601 - Attachment description: WIP: Bug 1811128 - Use 16/32px extension icons in toolbars. r?rpl! → Bug 1811128 - Use 16/32px extension icons in toolbars. r?rpl!
Status: NEW → ASSIGNED
Whiteboard: [addons-jira]
Attachment #9313601 - Attachment description: Bug 1811128 - Use 16/32px extension icons in toolbars. r?rpl! → Bug 1811128 - Use 16/32px extension icons in toolbars. r?rpl!,dao!
Pushed by wdurand@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/11266428de1b Use 16/32px extension icons in toolbars. r=rpl,dao
Severity: -- → S4
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch

Verified as Fixed on the latest Nightly (111.0a1/20230130214413). Tested on Windows 10 x64 and Ubuntu 16.04 LTS.

The pinned to toolbar icon is no longer smudged and looks sharper. For further details, see the attached screenshot depicting the icon before the fix (upper part of the image) and the icon after the fix (lower part of the image).

Status: RESOLVED → VERIFIED
Attached image 2023-01-31_09h32_41.png

The patch landed in nightly and beta is affected.
:willdurand, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox110 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(wdurand)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: