W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

Re: [whatwg] Features for responsive Web design

From: Maciej Stachowiak <mjs@apple.com>
Date: Tue, 22 May 2012 14:01:02 -0700
Message-id: <50E6B27A-950D-492C-890E-CB5BB38E2396@apple.com>
To: Kornel Lesiński <kornel@geekhood.net>
Cc: Mathew Marquis <mat@matmarquis.com>, whatwg <whatwg@whatwg.org>

On May 21, 2012, at 9:37 PM, Kornel Lesiński <kornel@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
Received on Tuesday, 22 May 2012 21:02:04 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:13 UTC