Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't set intrinsic width from sizes since that's bogus. Don't set the i... #142

Merged
merged 1 commit into from Apr 14, 2014

Conversation

zcorpan
Copy link

@zcorpan zcorpan commented Apr 9, 2014

...ntrinsic resolution here; we return the density and the HTML spec handles the resolution with 'current pixel density'. Fixes #121 Fixes #107

(We may want to return the w/h descriptors too as part of #85.)

…e intrinsic resolution here; we return the density and the HTML spec handles the resolution with 'current pixel density'. Fixes ResponsiveImagesCG#121 Fixes ResponsiveImagesCG#107
@yoavweiss
Copy link
Member

Can you add a note saying that intrinsic sizing is handled by HTML, maybe with a link to where that happens?

@tabatkins
Copy link

Where does intrinsic width get set, if not here? In HTML?

@zcorpan
Copy link
Author

zcorpan commented Apr 9, 2014

"The user agent is expected to treat the element as a replaced element and render the image according to the rules for doing so defined in CSS."
http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#images-0

"For raster images without reliable resolution information, a size of 1 px unit per image source pixel must be assumed."
http://www.w3.org/TR/CSS21/conform.html#intrinsic

http://www.whatwg.org/specs/web-apps/current-work/multipage/edits.html#current-pixel-density overrides the density.

Nothing sets the intrinsic dimensions before the image is loaded, but we could do that as part of #85.

@tabatkins
Copy link

Okay, my setting of the intrinsic width here in the algo was intentional. That's part of the point of sizes=''.

@zcorpan
Copy link
Author

zcorpan commented Apr 10, 2014

I thought the point of sizes was to give the UA a ballpark estimate on how big the image is going to be in the layout, so that it can download an appropriately sized image from the list. I fail to understand how such a value is appropriate for the intrinsic width. The width descriptor divided by the density would be a more accurate source for use as the intrinsic width, but it still seems useless to set intrinsic width without also setting intrinsic height.

@tabatkins
Copy link

Oh wait, on further consideration, you might be right. It's hard to remember precisely what my earlier intention was. I suppose the intrinsic width is best set from from w descriptor.

I agree that having an intrinsic width isn't greatly useful without an intrinsic height, which is why I planned to allow h descriptors as well. We haven't added those yet, though. (Tracked in #86.)

@zcorpan
Copy link
Author

zcorpan commented Apr 14, 2014

So OK to merge?

tabatkins added a commit that referenced this pull request Apr 14, 2014
Don't set intrinsic width from sizes since that's bogus. Don't set the i...
@tabatkins tabatkins merged commit d48418c into ResponsiveImagesCG:gh-pages Apr 14, 2014
@zcorpan zcorpan deleted the fix-121-107 branch April 14, 2014 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Intrinsic width is bogus Where to set intrinsic width/resolution
3 participants