Re: Overflow and Margins

On Feb 3, 2008, at 3:07 PM, Ben Cotterell wrote:

>
> On Sun, Feb 03, 2008 at 11:23:24PM +0100, Bruno Fassino wrote:
>>
>> Alan Gresley wrote:
>>
>>> The other lot of test cases is for an overflow box with width
>>> of length 400px:
>>>
>>>
>> http://css-class.com/test/css/viseffects/overflow-length-with- 
>> inner-box.htm
>> [...]
>>>
>>> Gecko 1.8 diverges from Gecko 1.9 and Safari 3 with the width of the
>>> scrollable box from example 3a in each test case. This is where  
>>> padding
>>> is introduced on the overflow box.
>> [...]
>>> In no part of 10.3.3 does it mentioned if padding-right is also  
>>> ignored
>>
>>
>> This behavior of Gecko 1.9 and Safari 3 (no 'visible' right- 
>> padding and the
>> 'end' of the overflowing content) looks the easier to explain to  
>> me (even
>> though it could be the less desirable.)
>> An interpretation could be the following:
>> The padding right is not ignored, but it is not at the 'end' of the
>> overflowing content (why should it be there?)
>> It is in the same place as if the overflow box had overflow  
>> visible, and the
>> overflowing content simply overlaps it.

I suppose that is what is happening, but it is not obvious. Since the  
scrollbars are drawn outside of the padding, one would naturally  
expect the padding (including the padding on the trailing edge) to be  
part of what scrolls.

>
> Yes, you're right.
>
> And I now realize I said something wrong in an earlier message. I  
> said:
>
>>> You should see the padding.
>
>>> If I do this:
>
>>> <div style="overflow: scroll; width: 200px; padding: 50px">
>>>      <div style="width: 600px; border: 2px solid green"></div>
>>> </div>
>
>>> I can scroll to the right and keep scrolling and see the 50px gap.
>>> Works in Firefox and Opera.
>
> It does "work" in Firefox and Opera, but it isn't right. As you  
> say, the
> container's right padding should be immediatley to the right of its
> content area container, not at the right of its overflowing contents.

Except that it is not just the content area that is scrolled. It is  
the padding box [1] that is scrolled, including the right padding and  
bottom padding. So if you scroll all the way to the right, you should  
then see the container's right padding immediately to the right of  
its content area container, just as you would if no scrolling was  
required.


>
> [...]
>> I'm absolutely not saying that the above is the real correct  
>> interpretation,
>> but it looks possible.
>
> I think it absolutely is the real correct interpretation. There's no
> justification for moving the container's padding just because its
> descendents overflow.

There is too, because you are moving the container's LEFT padding  
when you scroll. It is all part of the padding box within the extent  
box (or at least it should be).

>


[1] Definition of "padding box" (box includes outer edge of padding);  
http://www.w3.org/TR/CSS21/box.html#box-dimensions

Received on Monday, 4 February 2008 16:32:37 UTC