[CSS21] Shrink-to-fit

Hi,
While the 'shrink-to-fit' width calculation is partly UA-dependant, 
parts of it is explicitly defined:

http://www.w3.org/TR/CSS21/visudet.html#q8
"Then the shrink-to-fit width is: min(max(preferred minimum width, 
available width), preferred width)."

However, it seems to me that actual implementations do not quite use the 
above definition?

I would have expected the above to yield a result very similar to table 
column widths; there is a definite minimum content width and the 
resulting width does not depend on the actual final layout of the 
contents of the lines, but more on a calculated widest possible and most 
narrow content dimensions.

Instead what i think i see in implementations is that the "preferred 
minimum width" seems to be 0 and that the preferred width is not just 
the "widest possible line" but instead a list a of possible line break 
occurences? Eg. the implementations seem to be something like:

shrink-to-fit width: min(max(0, available width), nearest narrower 
possible break opportunity() ).

Is the above about right and if so, what is the intention of the WG here?

In my opinion, the spec way seems better since it yields more consistent 
results that fit better with the usual CSS principles. I also think that 
the cases where shrink-wrap is used could work better with such a 
calculated min-width when overconstrained.

  /Staffan

Received on Wednesday, 31 August 2005 15:06:58 UTC