Re: 'image-fit' vs preserveAspectRatio

On Fri, 24 Apr 2009 08:59:32 +0200, Erik Dahlström <ed@opera.com> wrote:

> On Wed, 22 Apr 2009 15:33:33 +0200, Giovanni Campagna <scampa.giovanni@gmail.com> wrote:
>
>> 2009/4/22 Philip Jägenstedt <philipj@opera.com>:
>>> On Tue, 21 Apr 2009 20:51:29 +0200, fantasai <fantasai.lists@inkedblade.net>
>>> wrote:
>>>
>>>> Erik Dahlström wrote:
>>>>>
>>>>>>> Previously, the CSS spec had the same keywords as SVG. What's
>>>>>>> the reason for the change?
>>>>>>
>>>>>> The keywords were initially taken from SMIL 1.0, but it was felt that
>>>>>> the functionality was different enough that we should use different names to
>>>>>> prevent confusion.  Also, the CSS group felt that the previous keywords
>>>>>> weren't as descriptive as they could be.
>>>>>
>>>>>  The SVG WG seemed to be ok with a new property, and could adopt it for
>>>>> use in SVG too, but 'image-fit' wasn't seen as a general enough name.
>>>>>  See http://www.w3.org/2009/03/16-svg-minutes.html#item06
>>>>
>>>> Actually, the original name in the CSS draft was copied from SMIL
>>>> and was 'fit', not 'preserveAspectRatio'. The CSSWG felt 'fit'
>>>> was too general--since in CSS it only applies to replaced elements,
>>>> and not to any other boxes--and decided to rename it 'image-fit'.
>>>> I can't speak for the WG, but I think we'd be open to renaming it
>>>> to align better with SVG. However, I don't think 'aspect-ratio'
>>>> is a good name because this property doesn't give an aspect ratio.
>>>>
>>>> I'm not coming up with any good alternatives here, just
>>>>   fit-scaling: fill | cover | contain
>>>>   fit-position: <background-position>
>>>> If you've got any other ideas throw them in...
>>>>
>>>> ~fantasai
>>>>
>>>
>>> How about content-fit and content-position? Perhaps this clashes too much
>>> with the content property, to which it isn't really related.
>>
>> content-fit is how the content (the content property, being it
>> "contents" or "url" or an arbitrary string) fits inside the box (or
>> set of boxes) generated by the element. So it is related to content,
>> and I support "content-fit".
>
> 'content-fit' would be ok with me.
>
> Note that it may be slightly confusing for svg authors since preserveAspectRatio="none" means the same as image-fit="fill", and image-fit="none" means something else.
>
>> I don't really support content-position: if you want to change the
>> shape of content area, you normally change padding, don't you?
>
> Does having 'content-position' change the content box? I think it only offsets what's shown inside the content box, right?
> And isn't changing the padding really just affecting what's outside the content-box?
>
> I think 'content-position' is fine.
>
> Note that these are my personal opinions, not necessarily the opinion of the SVG WG.

The naming was briefly discussed in another SVG telcon[1], and the conclusion was that the SVG WG prefers the naming 'content-fit' and 'content-position' because of the reasons already mentioned above.

Cheers
/Erik, on behalf of the SVG WG (ACTION-2530)

[1] http://www.w3.org/2009/04/27-svg-minutes.html#item05

-- 
Erik Dahlstrom, Core Technology Developer, Opera Software
Co-Chair, W3C SVG Working Group
Personal blog: http://my.opera.com/macdev_ed

Received on Wednesday, 29 April 2009 12:26:24 UTC