Re: Feedback on 'image-fit' and 'image-position'

Hello,

We have further comments on 'image-fit' and 'image-position'. First,  
please note the following (which is waiting in the moderation queue of  
this list):

Leif Arne Storset <lstorset@opera.com> skreiv Thu, 04 Feb 2010 16:16:17  
+0100

> On 21 Jan, Simon Pieters wrote:
>
>> Regarding image-fit and image-position:
>> http://dev.w3.org/csswg/css3-page/#propdef-image-fit
>> http://dev.w3.org/csswg/css3-page/#propdef-image-posn
>> We have the following feedback:
.
>> * New auto value
>> WebKit, Gecko and Opera render SVG, bitmaps and videos differently in  
>> <object>. Using any single value of image-fit would break this  
>> compatibility. We suggest a new value auto that will maintain the  
>> status quo.
>>
>> Suggestion: Under 10.2 The ‘image-fit’ Property, add "auto" to the list  
>> of values. In the description, add the following:
>>    auto
>>        Choose a method of scaling the content based on its type. The  
>> following table gives the rendering for each type:
>>       Content | Scale as if image-fit:
>>        --------+------------------------
>>        bitmap  | fill
>>        SVG     | none
>>        video   | contain
>
> We have contacted WebKit and were told that their implementation of  
> rendering SVG in <img> as if 'image-fit: fill' is a bug. Therefore we  
> now suggest that 'auto' be the new initial value. We have revised the  
> table to the following:
>
>         Content  | Rendering
>         ----------------+-----------------------------------------------
>         bitmap          | as if image-fit: fill
>         video           | as if image-fit: contain
>         SVG in <img>   | synthesize a viewbox if none is specified and
>                           respect preserveAspectRatio
>         SVG in <object> | if a viewbox is provided, respect preserveAs-
>         or <svg>          pectRatio; otherwise, as if image-fit: none;
>                           image-position: top left
>
> This makes all values of 'image-fit' except 'auto' predictable, while  
> 'auto' maintains backward compatibility by default for all cases.

We found that for complete backwards-compatibility, image-position cannot  
override preserveAspectRatio. Therefore we suggest to add the following  
note in the description for the image-position property:

     When rendering SVG with the property 'image-fit' set to 'auto',
     this property is ignored, and SVG's own preserveAspectRatio
     attribute will take effect instead.

-- 
Leif Arne

Received on Tuesday, 16 February 2010 15:16:35 UTC