Centralize manifest icon selection in a single place [chromium/src : main]

0 views
Skip to first unread message

Nate Chapin (Gerrit)

unread,
Jan 14, 2026, 5:44:06 PM (3 days ago) Jan 14
to Daniel Murphy, AyeAye, Christian Biesinger, chromium...@chromium.org, Kaan Icer, Peter Beverloo, Chromium LUCI CQ, mek+w...@chromium.org, aixba+wat...@chromium.org, japhet+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watch...@chromium.org, dmurph+watc...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, nator...@chromium.org, npm+...@chromium.org, philli...@chromium.org, pkotwic...@chromium.org, rayanka...@chromium.org, sloboda...@chromium.org, webapks-...@chromium.org, webap...@microsoft.com, yigu+...@chromium.org, zelin+watch-we...@chromium.org
Attention needed from Daniel Murphy

Nate Chapin added 2 comments

Patchset-level comments
File-level comment, Patchset 8 (Latest):
Nate Chapin . resolved

I reworked a few details of the draft you sent me, in addition to ensure it passes tests.

Note that this doesn't do anyhting with manifest filtering - this is just the icon selection.

File chrome/test/data/web_app_file_handling/icons_app_manifest.json
Line 7, Patchset 8 (Parent): "sizes": "144x144"
Nate Chapin . resolved

Minimum size is 144x144, but this icon isn't actually 144x144 and that's now a failure.

Open in Gerrit

Related details

Attention is currently required from:
  • Daniel Murphy
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I2e0290db6d993c9cbc01ad93f3ad70ebbf64b50f
Gerrit-Change-Number: 7417994
Gerrit-PatchSet: 8
Gerrit-Owner: Nate Chapin <jap...@chromium.org>
Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
Gerrit-CC: Kaan Icer <ic...@chromium.org>
Gerrit-CC: Peter Beverloo <pe...@chromium.org>
Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
Gerrit-Comment-Date: Wed, 14 Jan 2026 22:43:54 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Daniel Murphy (Gerrit)

unread,
Jan 15, 2026, 10:54:28 AM (2 days ago) Jan 15
to Nate Chapin, Daniel Murphy, AyeAye, Christian Biesinger, chromium...@chromium.org, Kaan Icer, Peter Beverloo, Chromium LUCI CQ, mek+w...@chromium.org, aixba+wat...@chromium.org, japhet+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watch...@chromium.org, dmurph+watc...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, nator...@chromium.org, npm+...@chromium.org, philli...@chromium.org, pkotwic...@chromium.org, rayanka...@chromium.org, sloboda...@chromium.org, webapks-...@chromium.org, webap...@microsoft.com, yigu+...@chromium.org, zelin+watch-we...@chromium.org
Attention needed from Nate Chapin

Daniel Murphy added 4 comments

File chrome/test/data/web_app_file_handling/icons_app_manifest.json
Line 7, Patchset 8 (Parent): "sizes": "144x144"
Nate Chapin . resolved

Minimum size is 144x144, but this icon isn't actually 144x144 and that's now a failure.

Daniel Murphy

interesting - I believe the code **should** request to download the icon at the size here, so even though the image is icon128, it should 'download' to a 144x144? Unless the web contents image downloading thing isn't what I think it is.

File third_party/blink/common/manifest/manifest_icon_selector.cc
Line 31, Patchset 8 (Latest): {".jpg", "image/jpeg"},
{".jpeg", "image/jpeg"},
{".ico", "image/x-icon"},
{".bmp", "image/bmp"},
{".gif", "image/gif"},
Daniel Murphy . unresolved

can you double check this isn't a regression? I believe we only want to do the above types, I think AI just added these for unknown reason - but maybe we used to allow the IsSupportedImageMimeType?

Line 160, Patchset 8 (Latest): // TODO make this logic a little better - if we are kClosestFit, we likely
// want to use 'any' before non-0 diff. Check previous implementation usage.
Daniel Murphy . unresolved

fyi - this was my todo to fix the algorithm - did you make this change?

File third_party/blink/common/manifest/manifest_icon_selector_unittest.cc
Line 24, Patchset 8 (Parent):class ManifestIconSelectorTest : public testing::TestWithParam<bool> {
Daniel Murphy . unresolved

I worry a little bit about the tests not being the same - is it possible to make an adapter from the old call method to the new one, to be able to run these old tests with the new algorithm?


I yeah - I believe there was a thing where the old behavior would do this:

- icons:
- a: 64
- b: 96
- c: 145
- d: any

If the ManifestIconSelector code was queried for a 144 icon, it would return d instead of c.

Can you make sure that behavior still works?

Open in Gerrit

Related details

Attention is currently required from:
  • Nate Chapin
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I2e0290db6d993c9cbc01ad93f3ad70ebbf64b50f
    Gerrit-Change-Number: 7417994
    Gerrit-PatchSet: 8
    Gerrit-Owner: Nate Chapin <jap...@chromium.org>
    Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
    Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
    Gerrit-CC: Kaan Icer <ic...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Nate Chapin <jap...@chromium.org>
    Gerrit-Comment-Date: Thu, 15 Jan 2026 15:54:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Nate Chapin <jap...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Nate Chapin (Gerrit)

    unread,
    Jan 16, 2026, 7:52:29 PM (17 hours ago) Jan 16
    to Daniel Murphy, AyeAye, Christian Biesinger, chromium...@chromium.org, Kaan Icer, Peter Beverloo, Chromium LUCI CQ, mek+w...@chromium.org, aixba+wat...@chromium.org, japhet+...@chromium.org, blink-re...@chromium.org, blink-...@chromium.org, dibyapal+wa...@chromium.org, dmurph+watchi...@chromium.org, dmurph+watch...@chromium.org, dmurph+watc...@chromium.org, kinuko...@chromium.org, kuragin+web-ap...@chromium.org, loyso...@chromium.org, mgiuca...@chromium.org, nator...@chromium.org, npm+...@chromium.org, philli...@chromium.org, pkotwic...@chromium.org, rayanka...@chromium.org, sloboda...@chromium.org, webapks-...@chromium.org, webap...@microsoft.com, yigu+...@chromium.org, zelin+watch-we...@chromium.org
    Attention needed from Daniel Murphy

    Nate Chapin added 4 comments

    File chrome/test/data/web_app_file_handling/icons_app_manifest.json
    Line 7, Patchset 8 (Parent): "sizes": "144x144"
    Nate Chapin . resolved

    Minimum size is 144x144, but this icon isn't actually 144x144 and that's now a failure.

    Daniel Murphy

    interesting - I believe the code **should** request to download the icon at the size here, so even though the image is icon128, it should 'download' to a 144x144? Unless the web contents image downloading thing isn't what I think it is.

    Nate Chapin

    Reverted this, it's not needed anymore.

    File third_party/blink/common/manifest/manifest_icon_selector.cc
    Line 31, Patchset 8: {".jpg", "image/jpeg"},

    {".jpeg", "image/jpeg"},
    {".ico", "image/x-icon"},
    {".bmp", "image/bmp"},
    {".gif", "image/gif"},
    Daniel Murphy . resolved

    can you double check this isn't a regression? I believe we only want to do the above types, I think AI just added these for unknown reason - but maybe we used to allow the IsSupportedImageMimeType?

    Nate Chapin

    This appears to be an attetmpt to combine the existing ManifesetIconSelector logic (which was based solely on MIME type) with `IsIconTypeSupported` in installable_evaluator.cc (which also looked at file endings, but only accepted a smaller set of image types). The synthesis is to accept all the image types blink can decode, and to use `net/` helpers to impute MIME type based on file extensions when a MIME type isn't explicitly given. See most recent PS.

    Line 160, Patchset 8: // TODO make this logic a little better - if we are kClosestFit, we likely

    // want to use 'any' before non-0 diff. Check previous implementation usage.
    Daniel Murphy . unresolved

    fyi - this was my todo to fix the algorithm - did you make this change?

    Nate Chapin

    We used to use `any` before non-0 diff, except in trusted_icon_filter.cc. That's now the main place we use `ManifestIconSelectorParams::AnySizeSvgHandling::kAsFallback` to reverse the order.

    I'm still trying to understand whether trusted_icon_filter.cc *should* have different behavior than other cases.

    File third_party/blink/common/manifest/manifest_icon_selector_unittest.cc
    Line 24, Patchset 8 (Parent):class ManifestIconSelectorTest : public testing::TestWithParam<bool> {
    Daniel Murphy . resolved

    I worry a little bit about the tests not being the same - is it possible to make an adapter from the old call method to the new one, to be able to run these old tests with the new algorithm?


    I yeah - I believe there was a thing where the old behavior would do this:

    - icons:
    - a: 64
    - b: 96
    - c: 145
    - d: any

    If the ManifestIconSelector code was queried for a 144 icon, it would return d instead of c.

    Can you make sure that behavior still works?

    Nate Chapin

    I think the `SvgHandling` test covers this behavior - whether c or d will be preferred is determined by the `AnySizeSvgHandling` flag.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Daniel Murphy
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I2e0290db6d993c9cbc01ad93f3ad70ebbf64b50f
    Gerrit-Change-Number: 7417994
    Gerrit-PatchSet: 14
    Gerrit-Owner: Nate Chapin <jap...@chromium.org>
    Gerrit-Reviewer: Daniel Murphy <dmu...@chromium.org>
    Gerrit-Reviewer: Nate Chapin <jap...@chromium.org>
    Gerrit-CC: Christian Biesinger <cbies...@chromium.org>
    Gerrit-CC: Kaan Icer <ic...@chromium.org>
    Gerrit-CC: Peter Beverloo <pe...@chromium.org>
    Gerrit-Attention: Daniel Murphy <dmu...@chromium.org>
    Gerrit-Comment-Date: Sat, 17 Jan 2026 00:52:20 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Daniel Murphy <dmu...@chromium.org>
    Comment-In-Reply-To: Nate Chapin <jap...@chromium.org>
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages