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

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 UTC