Re: [css3-images] object-fit interactions with min/max sizing

On Wed, May 25, 2011 at 6:08 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> I just did some CVS archaeology for Tab on why the definitions for
> object-fit
> interact with the min/max properties the way they do in the definitions
> agreed
> to by the CSSWG. You can see that text in old drafts of CSS3 Paged Media:
>  http://dev.w3.org/cvsweb/~checkout~/csswg/css3-page/Overview.html?rev=1.71;content-type=text%2Fhtml#img-fit
>
> The text was added originally on 14 November 2006, based on proposed text
> from mid-October 2006, following discussions across the F2F and the internal
> mailing list. (This was before the CSSWG decision to work in public.)
> The discussion at the F2F was triggered by something I posted at
>  http://fantasai.inkedblade.net/style/specs/css2.1/min-max-replaced-2/
> which I will reproduce here for archiving.
[snip]
> Second problem: 'fit' doesn't resize the image box, it just changes how the
>  image is painted within it.
> We can fix that by adding a new value that resizes the box, or by defining
> different behavior for when min/max constraints take effect. For example,
>
>  | If both 'height' and 'width' are 'auto' and both 'max-width' and
>  | 'max-height' are given, then the calculate the used value of the width
>  | and height as if the intrinsic size of the image were infinitely large.
>
> We can put this under the definition of 'fit: meet'.

Thanks for this, fantasai!  I've gone ahead and put the relevant text
back in for now.

It took me a while to digest what the actual reasoning was for this.
It appears that it was a result of wanting to switch between behavior
B and C (described in the elided portions of your email that I quoted
- B means honoring the author's width/height declarations above the
native aspect-ratio when min/max declarations cause problems, C means
the opposite).  Since replaced elements are the only thing that can
have an aspect-ratio currently, it was considered reasonable to
smuggle this behavior into the object-fit property.

I'd like to reopen this issue, as I don't think it's a good solution.
For one, this behavior is unrelated to scaling the contents of
replaced elements, so it's kinda random and nonintuitive that
'object-fit' can have this effect.  For two, I have a draft of an
'aspect-ratio' property that I'd like to work on officially later this
year that would grant any element the ability to have an aspect-ratio,
which would make the B/C behavior switch relevant to all elements.
Having 'object-fit' be the behavior switch for normal elements would
be *completely* crazy.

I'll start a new thread about this.

~TJ

Received on Saturday, 28 May 2011 00:38:01 UTC