[whatwg] Features for responsive Web design

=?GB2312?Q?Kornel_Lesi=A8=BDski?= kornel at geekhood.net
Tue May 22 14:44:18 PDT 2012


Sorry, I forgot to clarify this ¡ª I had in mind adding width/height on each <source> element, not on <picture>.

-- 
regards, Kornel


On 22 maj 2012, at 16:01, Maciej Stachowiak <mjs at apple.com> wrote:

> 
> On May 21, 2012, at 9:37 PM, Kornel Lesi¨½ski <kornel at geekhood.net> wrote:
> 
>> 
>> 
>>> There¡¯s no prior precedent this sort of thing¡ªthere¡¯s no reason we can¡¯t find a way to preserve an image¡¯s intrinsic width using `picture`. I wonder if simply adding `width` and `height` attributes on the element (similar to `img`) might solve this, in the event that the author wants to rely on an intrinsic size instead of CSS?
>> 
>> I think that is a very good idea. Having option to do so is good for performance, as it avoids reflows.
> 
> If 'width' and 'height' attributes on the <picture> element would do the same thing as they do on <img>, then they would be setting the size via style, rather than setting intrinsic size. Even if setting the size explicitly affected intrinsic size rather than size computed via style, it would miss the point of intrinsic size, which is that images get automatically the right amount of space based on the image itself. Auto-sizing may not be the right choice for all designs, but it is for some designs.
> 
> - Maciej
> 



More information about the whatwg mailing list