whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
8.18k stars 2.71k forks source link

Create reusable image fetching logic for other standards #4474

Open domenic opened 5 years ago

domenic commented 5 years ago

Ported from https://www.w3.org/Bugs/Public/show_bug.cgi?id=24055. Standards like Notifications or Web App Manifest need to fetch images. It's unclear which portions of <img>'s very-complicated processing model they should involve, but in that bug people seem to be advocating for at least MIME sniffing and the "list of available images" cache.

This also impacts <input type="image">, and probably <link rel="icon">.

The thread is long and someone planning to tackle this should probably read through it and distill it here before going too far.

Note: #1643 is probably a prerequisite for this issue.

annevk commented 4 years ago

This is also needed for CSS background-image et al. All fetching of images should share the same pipeline.

annevk commented 4 years ago

See also https://github.com/w3c/csswg-drafts/issues/5173 and various issues linked from there.

zcorpan commented 4 years ago

This was discussed a few days ago in the WHATWG TPAC breakout session. Minutes at https://www.w3.org/2020/10/26-whatwg-minutes.html#fetching (cc @emilio )

zcorpan: old issue. Browsers are probably reusing image loading logic for many things, but HTML Standard only specifies special logic for <img>. This makes adding new image-loading features, e.g. to CSS, hard. No work in the last 7 years to my knowledge. Any progress on solving this, or new information on how to solve?

emilio: interop issues with CSS images having different caching policies. But usually all browsers have a centralized image loader. Shared caches, and so on.

zcorpan: also an issue with the image cache. Probably doesn't match implementations.

emilio: changed Gecko to match spec a bit better for image cache. This can also affect preloading.

Domenic: interest from chromium to work on memory cache, image cache..

emilio: arch in gecko is different from chromium. if you have an uncachable image loaded from a stylesheet, (something something)

Domenic: interop issue is important. emilio you seem to have knowledge about this

emilio: happy to work on this

<annevk> And with EXIF there’s decoding considerations too that need centralization (And I guess in general we want uniform image decoders across features that consume images.)

Domenic: I'll take the action item to start the discussion to collate the concrete interop issues.