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

Intrisinic dimensions adaptation only when sizes is explicit? #253

Closed
yoavweiss opened this Issue Nov 18, 2014 · 8 comments

Comments

Projects
None yet
5 participants
@yoavweiss
Member

yoavweiss commented Nov 18, 2014

The conversation on http://ircbot.responsiveimages.org/bot/log/respimg/2014-11-14#T100930 made me wonder if we'd be better off if the intrinsic width adaptation of sizes and the w descriptor would happen only when sizes is explicitly defined by the author (and not when it is missing and defaults to 100vw). Otherwise, I fear confusion around that would continue.

Thoughts?

@eeeps

This comment has been minimized.

Show comment
Hide comment
@eeeps

eeeps Nov 18, 2014

This would add another wrinkle for people who want to fully understand the feature. “The default sizes is 100vw, but no sizes attribute at all behaves differently than sizes=100vw in this one weird way.”

For people with no understanding of how sizes and srcset combine to create an intrinsic density, this change would make the default behavior more like what they're used to; <img srcset="a 100w" /> and <img src="a" /> would look the same.

Do we want to keep the new system simpler/more coherent, or complicate it so that it behaves more like the old markup that people are used to?

I lean towards the status quo, where sizes=100vw behaves the same as no sizes at all.

eeeps commented Nov 18, 2014

This would add another wrinkle for people who want to fully understand the feature. “The default sizes is 100vw, but no sizes attribute at all behaves differently than sizes=100vw in this one weird way.”

For people with no understanding of how sizes and srcset combine to create an intrinsic density, this change would make the default behavior more like what they're used to; <img srcset="a 100w" /> and <img src="a" /> would look the same.

Do we want to keep the new system simpler/more coherent, or complicate it so that it behaves more like the old markup that people are used to?

I lean towards the status quo, where sizes=100vw behaves the same as no sizes at all.

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

tabatkins Nov 18, 2014

sizes does not cause any size adaptation. This is obvious if you specify sizes and then don't use any w descriptors; the sizes value does nothing at all in this case.

All that sizes does is provide the second half of the "figure out x" equation, where the w value is the first half. Then, when the "effective x" has been found, that adjusts the intrinsic size as usual for x, and because of how the math works, it happens to adjust it to the sizes value.

It's nonsensical to ask for sizes to not result in any size adaptation at all; that's just asking for w to be invalid in that case.

tabatkins commented Nov 18, 2014

sizes does not cause any size adaptation. This is obvious if you specify sizes and then don't use any w descriptors; the sizes value does nothing at all in this case.

All that sizes does is provide the second half of the "figure out x" equation, where the w value is the first half. Then, when the "effective x" has been found, that adjusts the intrinsic size as usual for x, and because of how the math works, it happens to adjust it to the sizes value.

It's nonsensical to ask for sizes to not result in any size adaptation at all; that's just asking for w to be invalid in that case.

@zcorpan

This comment has been minimized.

Show comment
Hide comment
@zcorpan

zcorpan Jan 12, 2015

I agree we probably shouldn't change the semantics here, it seems it could make it harder to understand what w is supposed to do. Possibly we could require the sizes attribute to be present?

zcorpan commented Jan 12, 2015

I agree we probably shouldn't change the semantics here, it seems it could make it harder to understand what w is supposed to do. Possibly we could require the sizes attribute to be present?

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

tabatkins Jan 12, 2015

That would just effectively be making the default sizes 300px, no? That was the initial behavior, but we changed it to default to 100vw on purpose.

tabatkins commented Jan 12, 2015

That would just effectively be making the default sizes 300px, no? That was the initial behavior, but we changed it to default to 100vw on purpose.

@zcorpan

This comment has been minimized.

Show comment
Hide comment
@zcorpan

zcorpan Jan 13, 2015

No it would only be an authoring requirement, no behavior change.

zcorpan commented Jan 13, 2015

No it would only be an authoring requirement, no behavior change.

@sideshowbarker

This comment has been minimized.

Show comment
Hide comment
@sideshowbarker

sideshowbarker Jan 13, 2015

No it would only be an authoring requirement, no behavior change.

(The part about "authoring requirement" got my attention.) What precisely would that authoring requirement be? Under what conditions would the spec require the sizes attribute to be present?

sideshowbarker commented Jan 13, 2015

No it would only be an authoring requirement, no behavior change.

(The part about "authoring requirement" got my attention.) What precisely would that authoring requirement be? Under what conditions would the spec require the sizes attribute to be present?

@zcorpan

This comment has been minimized.

Show comment
Hide comment
@zcorpan

zcorpan Jan 13, 2015

When the srcset attribute has w descriptors.

zcorpan commented Jan 13, 2015

When the srcset attribute has w descriptors.

@tabatkins

This comment has been minimized.

Show comment
Hide comment
@tabatkins

tabatkins Jan 13, 2015

Yeah, that's probably good as an authoring requirement. While not technically required, if you leave out sizes it's confusing that using w makes your image full screen-width.

tabatkins commented Jan 13, 2015

Yeah, that's probably good as an authoring requirement. While not technically required, if you leave out sizes it's confusing that using w makes your image full screen-width.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment