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

Issue 635569 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Jul 9
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

Image.width is not density corrected by Content-DPR header

Reported by martin.a...@gmail.com, Aug 8 2016

Issue description

Chrome Version: 54.0.2824.0 (Development-Build) (64-Bit)
URL           : https://jsfiddle.net/td3mnurb/1/

What steps will reproduce the problem?
(1) Open https://jsfiddle.net/td3mnurb/1/ or the attached HTML page on a retina screen (2x DPR).

What is the expected result?
If an image is not rendered, the IDL attribute *width* should return the density-corrected intrinsic width: http://w3c.github.io/html/semantics-embedded-content.html#dom-htmlimageelement-width
In the mentioned example the console should log `400` two times on retina screens

What happens instead?
The console logs `800` and then `400`

Please provide any additional information below. Attach a screenshot if possible.

Example HTML page (https://jsfiddle.net/td3mnurb/1/):
```
<meta http-equiv="Accept-CH" content="DPR">
<script>
	var img = new Image();
	img.src = 'https://demo-res.cloudinary.com/image/upload/w_400,dpr_auto/bike.jpg';
	img.onload = function() {
		console.log(img.width); // Logs 400 on a 1x screen and 800 on a 2x screen
		console.log(img.naturalWidth); // Always logs 400
	}
</script>
```
 
Labels: Needs-Bisect
Cc: brajkumar@chromium.org
Components: Blink>Layout
Labels: -Type-Bug -Pri-3 -Needs-Bisect M-54 hasbisect OS-Mac OS-Windows Pri-2 Type-Bug-Regression
Owner: pdr@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce on Windows 10(HD-Touch) and Mac OS 10.11.6(Retina) using chrome latest Dev M54-54.0.2824.0.

Bisect Information:
=====================
Good build: 46.0.2480.0 
Bad Build : 46.0.2482.0 

Change Log URL: https://chromium.googlesource.com/chromium/src/+log/8fd640057d425eb29c3da205ec2e10a81ad99c6f..49bac10701d666cd09a9a636ed599ece997fe330

Blink Log URl:
https://chromium.googlesource.com/chromium/src/+log/8fd640057d425eb29c3da205ec2e10a81ad99c6f..49bac10701d666cd09a9a636ed599ece997fe330

From the above blink log suspecting below change

Review URL: https://codereview.chromium.org/1287773002

pdr@ - Could you please check whether this is caused with respect to your change, if not please help us in assigning it to the right owner.

Thanks!

Comment 3 by pdr@chromium.org, Aug 10 2016

Owner: y...@yoav.ws
Hi Yoav, I believe this is https://chromium.googlesource.com/chromium/blink/+/40f6e6c4847f782b2a74ae725549576261682cc8

I haven't investigated this bug further than looking at the bisect.

Comment 4 by y...@yoav.ws, Aug 30 2016

Labels: -Type-Bug-Regression Type-Bug
Summary: Image.width is not density corrected by Content-DPR header (was: Image.width is not density corrected as required by the spec)
This seems to be an issue related only to the Client-Hints feature, rather than a regression. I'll take a look.

Comment 5 by addyo@chromium.org, Mar 29 2017

Cc: addyo@chromium.org
Status: WontFix (was: Assigned)
Looking at the test case now, it seems like this was already resolved (I gets "400" logged twice). WONTFIXing as I'm unable to reproduce.

martin.auswoeger@ - if you still see this issue, please comment with ways to reproduce

Sign in to add a comment