Re: Proposal for "overflow:clip" for stronger painting isolation

On 10/17/13 2:57 PM, "Kang-Hao (Kenny) Lu" <kanghaol@oupeng.com> wrote:

>(2013/10/18 5:35), Tab Atkins Jr. wrote:
>> On Thu, Oct 17, 2013 at 2:23 PM, Bruno Racineux <bruno@hexanet.net>
>>wrote:
>>> Does this proposal address "clearing the float" at all?
>>>
>>> I would be ideal is there was a native solution for this by now, rather
>>> than the 'clearfix' hacks.
>>>
>>> And while 'overflow:hidden' helps, it's not a comprehensive solution to
>>> clear-fixing.
>> 
>> This is basically a more powerful/comprehensive overflow:hidden, so it
>> addresses float clearing as well as overflow:hidden does.
>
>I suppose this reads
>
>  'overflow: clip' doesn't address "clearing the float"
>
>? I am not criticizing the proposal as the use cases might just be
>parallel,

I bring this due to the implications between overflow:hidden and "clearing
the float". And for lack of introduction perhaps, I am curious to
understand what overflow:clip intends to achieve or address.

>but the above sentence is just vague and diffucult to parse, at least to
>me.

The way I read Tab, is that it would substitute the "overflow:hidden"
method of 
"clearing the float". But it is vague indeed.

For overflow:clip to claim being a substitute to the "clearfix" method,
I think the spec would first to need to explore every cases of clearfix
there are.

>
>The use case Bruno has is to specify 'clearfix' on an element without
>refering to the parent element and a pseudo-element, I think.

Yes, precisely.

>Was there a previous discussion about this on the list? Is this problem
>solved by switching to flex layout? If not, why?

I don't see any discussion mentioning the 'clearfix' term directly. Other
than this a while ago:
http://lists.w3.org/Archives/Public/www-style/2009Dec/0335.html

I believe (or rather assume) that Flexbox does fix the problem 'within
the flex layout', but that does not give a native clearfix property
outside of the 
Flex scope. The need to clearfix can apply to other situations.


Interestingly enough, there are cases with wrapped inline-blocks where
overflow: hidden; cause the baseline to overflow, due to this rule
(necessary for scrolling behavior as was explained to me by Boris Zbarsky)
in specs CSS 2.1:

<http://www.w3.org/TR/CSS2/visudet.html>:
"The baseline of an 'inline-block' is the baseline of its last line box in
the normal flow, unless it has either no in-flow line boxes or if its
'overflow' property has a computed value other than 'visible', in which
case the baseline is the bottom margin edge."

While the above conformance to the spec was buggy in Safari 5-6 and Chrome
(which cleared the flow regardless) it was recently fixed in Blink/Chrome
30.


But in the case of a <div> wrapping inline-blocks in it, overflow must be
'visible' in order to clear any baseline 'overflow' outside of the
inline-block flow.

i.e. 'overflow:hidden' prevents a clearfix in that context. Which seem
worth mentioning should overflow:clip intend to address the given use case
of clearing the float (or flow, as a more proper term in this case).

Received on Friday, 18 October 2013 08:39:04 UTC