Open Bug 1710188 Opened 3 years ago Updated 1 year ago

unsupported image types preload (AVIF and JXL)

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 88
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jsnkuhn, Unassigned)

Details

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

Steps to reproduce:

Set a preload link for browsers that support AVIF: <link rel="preload" href="https://tracker.randomania.net/dwr/images/alefgard_crop_test.avif" as="image" type="image/avif">

https://codepen.io/jsnkuhn/full/RwpNegy

Actual results:

Firefox downloaded the AVIF (wasting resources) but then could not load as a background image because it's not supported yet.

Expected results:

MDN article states that browsers should ignore `<link rel="preload"> for non supported mime types.

https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content#including_a_mime_type

The Bugbug bot thinks this bug should belong to the 'Core::ImageLib' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → ImageLib
Product: Firefox → Core

avif support should be turned on soon (in fact it has been on in general, but was turned off for a bit), so I expect this bug will get resolved by enabling avif.

Added jpeg xl (.jxl) and webp2 (.wp2) preloads to the codepen from above. Both he AVIF and the JXL show up in the network panel as downloaded even though neither are technically yet supported. The WEBP2 is skipped as it should be. Seems to me that this shows this is not just an AVIF issue.

https://codepen.io/jsnkuhn/full/RwpNegy

Summary: avif preloads although file type not supported → unsupported image type preloads although file type not supported

new test with just straight <img> tags: https://codepen.io/jsnkuhn/pen/gOmpWqZ?editors=1000

The JXL and AVIF download but can't be rendered.

So this is not preload related at all. I guess maybe just something about the way the headers are being set while ya'll work on implementing these new file types??

Summary: unsupported image type preloads although file type not supported → unsupported image types download (AVIF and JXL)

I wonder if this or something similar is what led chrome to add the ability to toggle unsupported images in dev tools?: https://developer.chrome.com/blog/new-in-devtools-88/#emulate-image

Either way, especially on mobile, waistful downloads like this can literally end up costing folk money in the long run.

Severity: -- → S3

Just looked up the definition of S3 and am a little confused. What "work around" exists for this?

Component: ImageLib → DOM: Core & HTML

(In reply to jsnkuhn from comment #4)

new test with just straight <img> tags: https://codepen.io/jsnkuhn/pen/gOmpWqZ?editors=1000

The JXL and AVIF download but can't be rendered.

So this is not preload related at all.

We can't judge from the extension on the url, the web expects browsers to download and render images with no extensions in the url etc.

Summary: unsupported image types download (AVIF and JXL) → unsupported image types preload (AVIF and JXL)

then shouldn't it be downloading the wp2 as well??

ahh, apologies. It is downloading the WP2 as an img it's just not showing up in images in the network panel.

Testing with just <picture> to get around the above issue:

no preload only the png loads: https://codepen.io/jsnkuhn/pen/gOmrJYa
WITH preload unsupported images download: https://codepen.io/jsnkuhn/pen/abJZvQB

same test but with css image-set() and type() (FF89 only)

no preload only the png loads: https://codepen.io/jsnkuhn/pen/VwpaOLo
WITH preload unsupported images download: https://codepen.io/jsnkuhn/pen/eYvzpeY

so... yes this is a preload issue?

I'm guessing that the reason WP2 isn't showing in the network image panel is the "octet-stream" type. This will probably fix itself as google solidifies WP2 and FF looks into implimenting.

Stable FF will soon support AVIF so the results of the above codepens will change. But the main issue of non-stuported images loading from <preload> still exists.

You need to log in before you can comment on or make changes to this bug.