W3C home > Mailing lists > Public > www-style@w3.org > January 2012

[css3-flexbox] computing "float" and "clear" on children of a flexbox

From: Daniel Holbert <dholbert@mozilla.com>
Date: Tue, 24 Jan 2012 18:34:15 -0800
Message-ID: <4F1F6A27.8070402@mozilla.com>
To: "www-style@w3.org list" <www-style@w3.org>
Hi www-style,

I've got a concern about how to compute the values of "float" and 
"clear" on direct children of a flexbox.

The spec says:
 > ‘float’ and ‘clear’ compute to their initial values on a flexbox item
(section 2.1)

This is problematic, because when we're computing style, we can't tell 
whether we've got a flexbox item.  This is because the definition of 
"flexbox item" involves more than the style tree -- it depends on 
whether the target element is "atomic" (e.g. a replaced element).  So, 
we don't know whether to apply the above-quoted special case.

Consider these two cases (img vs span):
   <div style="display: flexbox"><img style="float:left"></div>
   <div style="display: flexbox"><span style="float:left"></span></div>
The <img> is replaced, so the spec says it should get a computed style 
of "float:none".  The <span> is not, so the spec says it should get a 
computed style of "float:left" (i.e. it should float inside of its 
generated anonymous wrapper block).

Is this a known issue?  Does this cause problems for other rendering 
engines' style systems as well?

Received on Wednesday, 25 January 2012 02:34:44 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:10 UTC