Re: [css3-images] 'object-fit' and used dimensions

On 03/07/2012 08:40 AM, Leif Arne Storset wrote:
>
> The object-fit text refers to both 'height' and 'width' being 'auto', so
> your example is not addressed there (although it is addressed by fantasai's
> 2006 post). Perhaps you meant to use a max-width of 100px in your example
> above, instead of width?
>
> But I'm still not sure I understand what this paragraph is for. Perhaps it was intended to cover the cases mentioned in
> fantasai's 2006 post, but doesn't?

Right. The intention of the text that's being proposed to remove is to solve
the use case of scaling an image to cover or be contained by a particular 2D
size (which is what 'object-fit' does) but also resize the content box to
match the concrete object size (which 'object-fit' otherwise cannot do). The
text does this by triggering the resize behavior on when 'width' and 'height'
are both auto but the appropriate min/max constraints are set.

A sample use case would be a photo album where each image must be sized to
fit within a 100×100 square, but you want to put a box-shadow or a border
on the image, not on the square.

>> So, I'd like to drop this aspect of the object-fit behavior, and address
>> the use case in some future draft, such as whichever one ends up with the
>> aspect-ratio property.
>
> For the record, Opera's implementation is oblivious to the aspect you suggest dropping (and thus will be more conformant after
> dropping it).
>
> (I'm withholding explicit agreement until I actually understand the paragraph in question, but I'll probably be in favor of
> dropping it. :))

The CSSWG discussed this issue on the telecon today and resolved to accept
your proposal to drop this text. We plan to address the use case by a more
explicit switch in Level 4.

Minutes of this meeting:
   http://lists.w3.org/Archives/Public/www-style/2012Mar/0504.html

I assume that works for you? :)

~fantasai

Received on Thursday, 22 March 2012 03:29:01 UTC