Intrisinic dimensions adaptation only when sizes is explicit? #253

yoavweiss opened this Issue Nov 18, 2014 · 8 comments


None yet

5 participants


The conversation on 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.


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.


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 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?


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 commented Jan 13, 2015

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


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 commented Jan 13, 2015

When the srcset attribute has w descriptors.


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.

@zcorpan zcorpan closed this in 535e96b Jan 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment