W3C home > Mailing lists > Public > www-style@w3.org > January 2008

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

From: fantasai <fantasai.lists@inkedblade.net>
Date: Sun, 27 Jan 2008 16:57:34 -0800
Message-ID: <479D287E.9040303@inkedblade.net>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: www-style Mailing List <www-style@w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:00 GMT