Re: [csswg-drafts] [css-overflow] Is the box a scroll container if only one of 'overflow-x' or 'overflow-y' is 'clip'?

We started discussing this by email a long time ago, and never concluded:
http://www.w3.org/mid/4314D40D-454E-48E3-99E0-3AB126308744@rivoal.net

I said:

> overflow:clip is currently defined as the same as overflow:hidden, minus the scrolling abilities.
> This implies that it establishes a BCF.
> 
> http://dev.w3.org/csswg/css-overflow/#valdef-overflow-clip
> 
> Mozilla implements -moz-hidden-unscrollable, which is similar to clip, except that it does not cause the element to establish a BFC.
> 
> Should we keep things as they are, or align with Mozilla?
> 
> As a reminder, overflow:clip was introduced to be what overflow:visible computes to when contain:paint is specified. We could have achieved the same pain containment effects without this value, but having overflow compute to something other than visible allows the properties that depend on overflow not being visible to be used with non-scrollable paint containment (e.g. text-overflow). Had we not had it, you'd have to use overflow:hidden if you wanted paint:containment and text-overflow, inducing the browser into allocating a larger buffer than needed to prepare for potential scrolling, even though you intend no scrolling.
> 
> As far as I know, the properties that depend on overflow not being visible are:
> * text-overflow
> * resize
> 
> If there is a need for the element to establish a BFC for these properties to work normally, then we should to keep the spec as it is. If not, I don't have a strong opinion.
> 
> Do they? Doesn't seem so to me, but I might be missing something.

@tabatkins replied:

> If it doesn't establish a BFC, that means it can project invisible
> geometry outside of itself, via a projecting float.  That's
> ridiculous.  I'd love to hear the use-case behind
> `-moz-hidden-unscrollable`.

I followed up with:

> I'm curious too. What I gathered was that the goal was to avoid disturbing margin collapsing and have it fall out the same way it would with overflow:visible, not any particular interest in invisible floats peeking out. Not entirely sure what use cases this would matter for, though.

and as far as I know, we're still there.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1971#issuecomment-374859490 using your GitHub account

Received on Wednesday, 21 March 2018 08:07:16 UTC