Re: breaking overflow

On Dec 30, 2009, at 9:05 AM, Tab Atkins Jr. wrote:

>> In an
>> older discussion it was also suggested as a fix for nested elements with
>> backgrounds defined spilling over rounded corners set on parent elements.
> 
> This is related directly to overflowness.  I forget, though - is the
> current behavior (child elements without rounded corners spilling out
> beyond the parent element's rounded corner) intended?  

No, that is a bug:

# Backgrounds, but not the border-image, are clipped to the appropriate curve (as determined by ‘background-clip’). Other effects that clip to the border or padding edge (such as ‘overflow’ other than ‘visible’) also must clip to the curve. The content of replaced elements is always trimmed to the content edge curve. Also, the area outside the curve of the border edge does not accept mouse events on behalf of the element. [1]

> Or is it
> supposed to be changed, like how rounded corners are supposed to
> prevent text from spilling past the corner?

Right. The curve of the corner is the most reasonable place to apply the clipping, and should be done so consistently.

>> So I was wondering whether we are trying to avoid using overflow:hidden for
>> unrelated effects (more control over clearing and collapsing margins) or
>> whether it would be good to have a break-overflow property, allowing a
>> certain element to break out any overflow:hidden set on its parent?
> 
> That's interesting, and potentially useful.  

Hey that's what I said. Oh, you said it first. :-b

> Even when I've used
> overflow:hidden for correct reasons - I really do want the overflow to
> be hidden - I sometimes have children that I *do* want to 'overflow'.
> Often these children are abspos and just positioned outside of the
> block.

I brought up the idea of overflowed abspos children being visible beyond the clipped box a couple years ago, but there were some hairy problems associated with how that would would work with scrollbars that they might overlap, if I recall correctly.

> Given that I use overflow:hidden for much more than this (float
> management, mostly), this might also be useful for getting around
> problems with that.  

I'm still not understanding this. If you use 'overflow:hidden' to create a local clearing of a float, do you really have problems with that object clipping its children at its curved corners? Doing so should be preferred behavior regardless of the clearing aspect.


[1] http://www.w3.org/TR/2009/CR-css3-background-20091217/#the-border-radius

Received on Wednesday, 30 December 2009 18:47:58 UTC