Client hints: image not re-requested when `sizes` attribute is changed
Reported by
oliverj...@gmail.com,
Sep 1 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.25 Safari/537.36 Steps to reproduce the problem: Example: http://output.jsbin.com/jahogej/2 1. Enable client hints 2. Create an img 3. Open browser 4. Mutate `sizes` attribute What is the expected behavior? A new request is made with updated client hints representing the new width. What went wrong? No new request is made. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 61.0.3163.25 Channel: n/a OS Version: OS X 10.12.6 Flash Version: For context, we are using client hints on an image that can be expanded on click. When the image is expanded, we need to download a larger image. We inform the browser of this change by modifying the `sizes` attribute, but the browser does not respond to this. This works when using `srcset`—if the new `sizes` matches a different source in `srcset`, that source will be requested. See here for another example that should change on resize: https://imgix.github.io/client-hints-example/client-hints.html
,
Sep 6 2017
Clicking the image mutates the `sizes` attribute, which (I believe) should create a new image request with updated client hints, but it does not. If you inspect the DOM before and after clicking the image, you will see this attribute change. You can also monitor network requests to see there is no new request. Client hints are not supported in Firefox, so I would not expect this example to work at all there.
,
Sep 6 2017
Thank you for providing more feedback. Adding requester "ajha@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Sep 6 2017
I suspect the issue is that the "sizes" attribute is defined to have no effect when srcset is not present. We can look at this, but it seems like it might be a spec problem. I agree that your interpretation of what should happen is probably correct.
,
Sep 6 2017
Just be clear I understand, as I am not familiar with this spec. Is the following correct? In theory we should request a new image when the viewport changes or the width of the image changes. Since there is no explicit size for the image, we should be taking the intrinsic size from the "sizes" attribute. So when you change sizes we should re-request the image. What happens if you give an explicit image width and change that?
,
Sep 6 2017
I believe that to be correct. This already works when you provide a srcset, but not when using client hints. If the image has an explicit width (e.g. a CSS width), the browser should still request an image with the size defined by `sizes`?
,
Sep 6 2017
Assigning to igrigorik@, who presumably knows the spec. I would expect that an explicit width change would result in a new request. My point is that a new request should probably be made when the display pixels changes (the destination rect for painting the picture).
,
Sep 6 2017
,
Sep 9 2017
Hmm, I think this may be a gray and unspecified area in the spec and implementation. <img id="myImg" sizes="800px" src="https://assets.imgix.net/unsplash/bridge.jpg?ch=Width,DPR"> Per HTML spec, without srcset sizes is a no-op while, of course, with CH the idea is that you should be able to omit it. I have a feeling that we're short-circuiting the processing here.. without accounting for CH. Paging Yoav for sanity check.. :-)
,
Sep 18 2017
The NextAction date has arrived: 2017-09-18
,
Jan 14
|
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by ajha@chromium.org
, Sep 6 2017Components: Blink>Image
Labels: Needs-Feedback Needs-Triage-M61