Firefox favicon .ico retina size bug

Firefox chooses the favicon dynamically from an .ico file based on display density, but it doesn't always seem to choose the most appropriate size.

Steps to reproduce the issue

Expectation

I expect that the favicon will choose either the 16px or 32px version depending on whether the screen is retina or not. It doesn't seem correct to downscale a drastically larger icon since favicons have very limited real estate, and the smaller designs will typically look better scaled up.

Image reference table

Image Size
16 × 16 16px favicon
32 × 32 32px favicon
96 × 96 96px favicon

Computer information

External monitor

Source code

Source code is available on GitHub.