New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 761317 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: 2017-09-18
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Client hints: image not re-requested when `sizes` attribute is changed

Reported by oliverj...@gmail.com, Sep 1 2017

Issue description

UserAgent: 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
 

Comment 1 by ajha@chromium.org, Sep 6 2017

Cc: ajha@chromium.org
Components: Blink>Image
Labels: Needs-Feedback Needs-Triage-M61
Just to update, tested this on Mac OS 10.12.6 using canary 63.0.3207.0. Navigating to http://output.jsbin.com/jahogej/2 on Mac and clicking the image doesn't do anything. Similar behavior is observed on 50.0.2624.0.

However the same URL when navigated on Mac Firefox, shows the page as expanded image.

oliverjash@: Could you please confirm if this works fine anywhere and the observations above is seen at your end as well?

Thank you!

 
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.
Project Member

Comment 3 by sheriffbot@chromium.org, Sep 6 2017

Labels: -Needs-Feedback
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
Labels: -Needs-Triage-M61 BugSource-User PaintTeamTriaged-20170906 OS-Android OS-Chrome OS-Linux OS-Windows
Owner: schenney@chromium.org
Status: Assigned (was: Unconfirmed)
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.
Cc: y...@yoav.ws
Labels: Needs-Feedback
NextAction: 2017-09-18
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?


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`?
Cc: schenney@chromium.org
Owner: igrigo...@chromium.org
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).
Labels: -Needs-Feedback
Cc: igrigo...@chromium.org
Owner: y...@yoav.ws
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.. :-)
The NextAction date has arrived: 2017-09-18
Owner: yoavweiss@chromium.org

Sign in to add a comment