[Webkit-unassigned] [Bug 225562] New: Send the supported image mimetypes in the HTTP request header

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 8 13:20:32 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=225562

            Bug ID: 225562
           Summary: Send the supported image mimetypes in the HTTP request
                    header
           Product: WebKit
           Version: Safari 14
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: yann.lohier at gmail.com

Hi,

It would be great if Safari was sending the accepted image mimetypes in the Accept header for a document request.
That could save us a lot of (almost) redundant <source> in the HTML code.

Chrome does it, Firefox does it, and Safari does it... but only for images request.
That forces the developer to either have a list of sources, or to rely on a server-based solution for images requests (with a meaningless extension).

Safari supports WebP, now, but new formats are coming, and I hope that Safari will support them soon.
With all these new formats, every image tag could quickly look like this:

<picture>
<source srcset="path/to/my/1x/image.jxl 1x, path/to/my/2x/image.jxl 2x">
<source srcset="path/to/my/1x/image.avif 1x, path/to/my/2x/image.avif 2x">
<source srcset="path/to/my/1x/image.webp 1x, path/to/my/2x/image.webp 2x">
<img src="path/to/my/1x/image.jpg" srcset="path/to/my/1x/image.jpg 1x, path/to/my/2x/image.jpg 2x">
</picture>

Chrome and Firefox, on the other hand, since they're sending the list of the format they support, can receive:
<img srcset="path/to/my/image.jxl 1x, path/to/my/image.jxl 2x">

Of course, we could also parse the Safari user-agent to know which formats are supported (and maintain that code when a new format is supported), but it's way more complicated.

Plus, the Accept header Safari is currently sending is not that great, since it's possible to type the URL of an image directly into the address bar.
In that case, even a server-side mechanism won't be able to chose the most appropriate file to send, since Safari won't tell which image formats it supports in the Accept header (Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8).

Thank you for reading this long text :-)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210508/4cfa910b/attachment.htm>


More information about the webkit-unassigned mailing list