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


Regarding image-fit and image-position:

We have the following feedback:

  * overflow mismatch

The spec is inconsistent with Basic Box Model Module (where overflow is  
defined [1]). image-fit applies to replaced content, but depends on the  
overflow property, which does not apply to replaced content.

It seems simple enough to modify overflow to accept replaced content, but  
note that overflow allows more values than just visible and hidden. There  
are scrollbars and no-content/no-display bailouts. If these are not  
desired, the image-fit spec should explicitly say so. However, I suggest  
that we accept these values (and thus do not mention anything about them  
in particular).

Suggested change: In the Basic Box Model chapter on overflow, remove all  
mentions of "non-replaced".

  * Missing "none"

The none value only seems to be documented in the example and is not  
actually part of the property according to the current draft.

Suggestion: In the image-fit definition [2], add "none" to the list of  
values. In the description, add the following:

       Render the content at its intrinsic dimensions, overflowing if  

  * Fit to content or padding box?

Section 10.3 states that images are to be positioned relative to the  
padding box; in the initial case ("image-fit: fill") this means that the  
image covers the padding box. However, currently all browsers fit images  
to their content box. Is the spec unintentionally going against current  
practices, or am I missing something?

Furthermore, both 10.2 and 10.3 rarely state which box they are talking  
about. To me it seems like every instance of "box" should refer to the  
content box, except the last normative paragraph of section 10.2; it  
discusses overflow and probably should refer to the border box. Am I  
correct in this assumption?

I guess whoever wrote that copied stuff from 'background' and forgot to  
check if it actually made sense... :-)

  * Don't inherit

Inheriting is problematic for SVG because the SVG author probably won't  
expect all elements establishing new viewports to suddenly look different.  
It is difficult to see what advantages there would be for other replaced  
content, except perhaps multiple nested <object> fallbacks.

Suggestion: Do not inherit image-fit and image-position.

  * Move to another module

In chapter 10, the spec states that [3]
The following properties may be transferred to a more appropriate CSS  
module in the future.

This makes sense, given that the property is not only useful for paged  
media. One possible target might be the Generated and Replaced Content  
module, in the chapter Replaced content. [4]

  * 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  

Suggestion: Under 10.2 The ‘image-fit’ Property, add "auto" to the list of  
values. In the description, add the following:

       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


Simon Pieters
Opera Software

Received on Thursday, 21 January 2010 14:56:50 UTC