W3C home > Mailing lists > Public > www-style@w3.org > July 2012

Re: [css4-images] specifying intrinsic size for images that haven't loaded yet

From: L. David Baron <dbaron@dbaron.org>
Date: Sat, 28 Jul 2012 23:17:18 -0700
To: Alan Gresley <alan@css-class.com>
Cc: www-style@w3.org
Message-ID: <20120729061718.GA27067@crum.dbaron.org>
On Sunday 2012-07-29 16:07 +1000, Alan Gresley wrote:
> On 29/07/2012 3:21 PM, L. David Baron wrote:
> >This is not possible, since 'fill' is the initial value of
> >'object-fit', so it must be compatible with today's behavior.  And
> >today's behavior (per CSS 2.1) is that given something like:
> >
> >   <img src="..." width="1500" height="1000" style="width: 100%">
> >
> >in an 800px wide container, the image will end up being 800px wide
> >and 1000px tall, rather than 600px tall.
> >
> >If the height="1000" is omitted, then there's no knowledge of the
> >intrinsic dimensions prior to the image starting (at least) to load.
> 
> This is partly correct. It will still have an intrinsic ratio (since
> width="1500" is still present). I'm just wondering if 'contain' is
> what you are wanting.

No, it won't, since the style="width: 100%" overrides the
width="1500".

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                           http://www.mozilla.org/   𝄂
Received on Sunday, 29 July 2012 06:17:51 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:57 GMT