Re: Overflow and Margins

On Feb 4, 2008, at 10:07 AM, Ben Cotterell wrote:

>>> Contents are clipped to the padding box. But that doesn't change  
>>> _the
>>> position or size of the padding box_.
>>
>> It could if the specification were to clearly say it does, and the
>> implementors followed that spec.
>
> Yes but it's not clear how you would change the spec to achieve  
> this. A
> box can't have ragged padding.
>
> Consider this:
>
>     #foo, #bar { height: 100px; border: 2px solid black }
>     ...
>
>     <div style="width: 200px; padding: 50px; overflow: scroll">
>         <div id="foo" style="width: 400px"></div>
>         <div id="bar" style="width: auto"></div>
>     </div>
>
> I expect to see 50px of padding to the right of #bar. If I scroll  
> right,
> and get another 50px of padding to the right of #foo (which is what  
> you
> get in Firefox 2.0.0.11 for example, but which is wrong), then the
> container's padding is not even box-shaped.

I see what your saying. I suppose I would do it as follows:

1. Determine that the contents won't fit, begin calculating for the  
extent box.

2. Determine the maximum width needed, as though the 200px  
restriction didn't exist. Set the extent box width to 300px (instead  
of 250px), with the original container's background endtending the  
whole width.

3. Size all "auto" width content as though the container width is 200px.

It seems like something along those lines is already being done,  
except the extent box is sized to the width of the content plus the  
left padding. What makes adding the right padding so much harder than  
adding the left padding when determining the size of the extent box?

>
> It doesn't really make sense to define it that way, unless you want to
> make #bar's used width 400px, but often that won't be what authors  
> want.

Personally it is usually what I want, but I am not trying to impose  
that on others. For now, I just want to see all the padding, without  
changing how "auto" width is figured.

Received on Tuesday, 5 February 2008 04:42:48 UTC