Re: [CSS21] Question about width calculation for replaced elements with intrinsic percentage width

Boris Zbarsky wrote:
> 
> This is in reference to 
> http://www.w3.org/TR/2007/CR-CSS21-20070719/visudet.html#inline-replaced-width 
> 
> I'm having a bit of an issue with the last paragraph of this section:
> 
>   Percentage intrinsic widths are first evaluated with
>   respect to the containing block's width, if that width
>   doesn't itself depend on the replaced element's width.
>   If it does, then a percentage intrinsic width on that
>   element can't be resolved and the element is assumed to
>   have no intrinsic width.
> 
> Leaving aside the confusion over what "first" means there, since there 
> is no "later" to go with it, the problem I have is that "if that width 
> doesn't itself depend on the replaced element's width" can be rather 
> difficult to determine, since said dependency can be very indirect.  For 
> example, the containing block is an auto-width block or a 
> percentage-width block, and somewhere up its ancestor chain something is 
> shrink-wrapping.  Or tables might be involved anywhere in the ancestor 
> chain.
> 
> It would make more sense to me if a percentage intrinsic width were 
> treated more like a percentage specified width: always treated as a 
> percentage of the containing block width, whatever that may be.  For 
> shrink-wrapping purposes, the preferred width and preferred minimum 
> width could be either 300px, or whatever they are for an empty block 
> with a percentage width, or something else.
> 
> Thoughts?

Makes sense to me. I'd be surprised if this wasn't the original intention
and simply wasn't fully thought through when writing out the text.

Added as CSS2.1 Issue 33
   http://csswg.inkedblade.net/spec/css2.1#issue-33

You wouldn't happen to have a testcase handy?

~fantasai

Received on Monday, 28 January 2008 00:57:54 UTC