fantasai | 1 Aug 2012 03:56

[css3-sizing] fill-available and floats

Should 'fill-available' respond to the presence of floats?
E.g. if I size an element that is side-by-side with a float as 'fill-available',
should it fill its containing block or fill the remaining space after the float
has been placed?

(We currently do the latter for BFC roots with 'auto' widths.)

~fantasai

François REMY | 1 Aug 2012 09:27
Picon
Favicon
Gravatar

Re: [css3-sizing] fill-available and floats

If I understand correctly, "fill-available" is just a way to specify on any 
element the automatic behavior of a DIV (i.e. width-unconstrained block 
element). If this is right, it should behave like a DIV and therefore react 
to the presence of floats next to it. 

Boris Zbarsky | 1 Aug 2012 11:48
Picon
Favicon

Re: [css3-sizing] fill-available and floats

On 8/1/12 3:27 AM, François REMY wrote:
> If I understand correctly, "fill-available" is just a way to specify on
> any element the automatic behavior of a DIV (i.e. width-unconstrained
> block element). If this is right, it should behave like a DIV and
> therefore react to the presence of floats next to it.

Like what kind of div?  These two:

   <div></div>

   <div style="overflow: auto"></div>

react differently to the presence of floats in terms of their width (or 
more precisely, the latter reacts and the former does not).

-Boris

François REMY | 1 Aug 2012 12:10
Picon
Favicon
Gravatar

Re: [css3-sizing] fill-available and floats

My point was to say it should react the same way as auto does on a DIV. If 
the way DIVs react to floats depends on other properties, fill-available 
should probably do the same, to reuse the existing algorithm.

If that's too complex or undesirable, I have no strong opinion on this 
however.

-----Message d'origine----- 
From: Boris Zbarsky
Sent: Wednesday, August 01, 2012 11:48 AM
To: www-style <at> w3.org
Subject: Re: [css3-sizing] fill-available and floats

On 8/1/12 3:27 AM, François REMY wrote:
> If I understand correctly, "fill-available" is just a way to specify on
> any element the automatic behavior of a DIV (i.e. width-unconstrained
> block element). If this is right, it should behave like a DIV and
> therefore react to the presence of floats next to it.

Like what kind of div?  These two:

   <div></div>

   <div style="overflow: auto"></div>

react differently to the presence of floats in terms of their width (or
more precisely, the latter reacts and the former does not).

-Boris

(Continue reading)

Tab Atkins Jr. | 1 Aug 2012 18:51
Picon
Gravatar

Re: [css3-sizing] fill-available and floats

On Wed, Aug 1, 2012 at 3:10 AM, François REMY <fremycompany_pub <at> yahoo.fr> wrote:
> My point was to say it should react the same way as auto does on a DIV. If
> the way DIVs react to floats depends on other properties, fill-available
> should probably do the same, to reuse the existing algorithm.
>
> If that's too complex or undesirable, I have no strong opinion on this
> however.

That behavior is caused by BFCs excluding floats from the outside from
intruding into themselves.  I don't think it should be part of
"fill-available".  If we think it's valuable, we should expose it
separately, like we have with "min-height:contain-floats" exposing the
*opposite* BFC behavior (preventing internal floats from extending
outside of the element).

~TJ

Kang-Hao (Kenny) Lu | 15 Aug 2012 09:30
Favicon

Re: [css3-sizing] fill-available and floats

(12/08/01 18:10), François REMY wrote:
> My point was to say it should react the same way as auto does on a DIV.
> If the way DIVs react to floats depends on other properties,
> fill-available should probably do the same, to reuse the existing
> algorithm.

Why? You didn't provide a reason why 'fill-available' should reuse the
existing algorithm. Duplicating the keyword for the same behavior is
obviously not what we want to do here. In other words, in general, the
bigger the difference between the behavior of 'auto' and
'fill-available' the more things Web developers can do.

> If that's too complex or undesirable, I have no strong opinion on this
> however.

Duplicating the keyword wouldn't be complex. On the contrary, it's
pretty trivial. However, it might indeed not be what authors want.

I don't (yet) have an opinion to fantasai's question, but there are a
bunch of questions that are similar:

1. Should 'fill-available' on a 'inline-block' fill its containing block
or fill the remaining space after other contents in the same line have
been placed (assuming the break before the 'inline-block' is forbidden)?

2. Should 'fill-available' on a 'inline-block' fill its containing block
or the line box, which is smaller in the presence of a float.

Existing implementations (Chrome 23, Firefox 14) treat 'fill-available'
like 'auto' in these examples. It seems that doing the other way around
(Continue reading)


Gmane