Bug 163808 - img with srcset with width descriptor has incorrect intrinsic size
Summary: img with srcset with width descriptor has incorrect intrinsic size
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: data:text/html,<img%20srcset="https:/...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-10-21 13:47 PDT by mitz
Modified: 2016-11-14 17:34 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2016-10-21 13:47:50 PDT
To reproduce: navigate to the URL.
Expected: the image to render at a width of 96 CSS pixels
Actual: the image renders at a much bigger width
Comment 1 Radar WebKit Bug Importer 2016-10-21 14:09:55 PDT
<rdar://problem/28896267>
Comment 2 Dean Jackson 2016-11-14 17:29:18 PST
According to the HTML specification:

If the srcset attribute is present and has any image candidate strings using a width descriptor, the sizes attribute must also be present, and is a sizes attribute. The sizes attribute contributes the source size to the source set (if no source element was selected).

https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-sizes

However, the specification doesn't seem to say what we should do when we don't have a sizes attribute.
Comment 3 Dean Jackson 2016-11-14 17:30:07 PST
At the moment it seems we're using 100vw (or something like that).
Comment 4 Dean Jackson 2016-11-14 17:31:07 PST
Working URL: data:text/html,<img%20srcset="https://webkit.org/favicon.png%2096w"%20sizes="96px">
Comment 5 Dean Jackson 2016-11-14 17:32:56 PST
WebKit seems to do the same thing as Chrome in this error case.
Comment 6 Dean Jackson 2016-11-14 17:34:58 PST
As does Firefox.