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

Re: [whatwg] Features for responsive Web design

From: Smylers <Smylers@stripey.com>
Date: Sat, 8 Sep 2012 10:18:40 +0100
To: whatwg@lists.whatwg.org, "whatwg@whatwg.org" <whatwg@whatwg.org>
Message-ID: <20120908091840.GF1742@stripey.com>
Fred Andrews writes:

> From: mjs@apple.com
> 
> > > <img style="width: 10em" src="image-320x200.jpg"
> > > set="image-320x200.jpg 320 200 10k, image-640x400.jpg 640 400 40k,
> > > image-1280x800.jpg 1280 800 150k">
> > 
> > The layout size of that <img> element is not computable until all
> > external stylesheets have loaded, as you have written it.
> 
> Actually, the image width is '10em' in this example, without having to
> load any style sheets!

And how big is 10em? 1em is dependent on the font-size of the parent
element of the <img>, which may be set by an external style-sheet.

> The browser can immediately determine the image to use and load it in
> this particular case.

You see how easy it would be for authors to get this wrong, even if they
knew they had to put image sizes in-line in order to have good
performance and tried to do that. That you, the promoter of the feature,
can't even get it right suggests that it would also be hard for authors
to do so.

Cheers

Smylers
-- 
New series of TV puzzle show 'Only Connect' (some questions by me)
Mondays at 20:30 on BBC4, or iPlayer: http://www.bbc.co.uk/onlyconnect
Received on Saturday, 8 September 2012 09:19:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC