W3C home > Mailing lists > Public > www-style@w3.org > September 2015

Re: [css-break][css-floats] Float pushed to the next fragmentainer, what about its siblings?

From: Morten Stenshorne <mstensho@opera.com>
Date: Fri, 18 Sep 2015 20:36:46 +0200
To: Brad Kemper <brad.kemper@gmail.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, www-style@w3.org
Message-ID: <87y4g3a81t.fsf@aeneas.oslo.osa>
Brad Kemper <brad.kemper@gmail.com> writes:

>> On Sep 17, 2015, at 3:58 AM, Morten Stenshorne <mstensho@opera.com> wrote:
>> 
>> fantasai <fantasai.lists@inkedblade.net> writes:
>> 
>>>> On 09/01/2015 08:51 AM, Morten Stenshorne wrote:
>>>> When a float is pushed to the next fragmentainer (let's use multicol as
>>>> an example, so henceforth I'll use the term "column" instead of
>>>> "fragmentainer"), because it's unbreakable, and there's not enough space
>>>> remaining in the current column, should consecutive content also be
>>>> pushed to the next column, even if there's room for it in the previous
>>>> column?
>>>> 
>>>> Example:
>>>> 
>>>>     <div style="columns:2; column-fill:auto; height:10em; orphans:1; widows:1;">
>>>>         line before float<br>
>>>>         <img src="http://home.powertech.no/mstensho/gfx/bilen.jpg" style="float:left; height:10em;">
>>>>         line after float, but in which column?<br>
>>>>     </div>
>>>> 
>>>> Looks like I've been assuming that the answer is "yes, push everything
>>>> to the next column", seeing how I implemented it in Presto, but I cannot
>>>> find anything in the spec suggesting such behavior.
>>>> 
>>>> And I have a feeling that floats traditionally don't affect sibling
>>>> content in such ways; e.g.:
>>> 
>>> Another example, that's closer to what happens:
>>> 
>>> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cstyle%3E%0A.float%20{%20float%3A%20left%3B%20width%3A%204em%3B%20height%3A%204em%3B%20border%3A%20solid%3B%20}%0A.clear%20{%20clear%3A%20both%3B%20}%0A%3C%2Fstyle%3E%0A%0A%3Cp%3EFirst%20bit%20of%20text.%20Now%20a%20float%3A%20%3Cspan%20class%3D%27float%27%3E1%3C%2Fspan%3E%20Now%20more%20text.%20Now%20another%20float%3A%20%3Cspan%20class%3D%27float%27%3E2%3C%2Fspan%3E%20Now%20a%20third%20float%20that%20also%20has%20clearance%3A%20%3Cspan%20class%3D%27float%20clear%27%3E3%3C%2Fspan%3E%20And%20here%20is%20the%20text%20after%20the%20cleared%20float.
>>> 
>>> Here we have a float in the middle of the text that is cleared.
>>> It goes below the previous floats, but it doesn't push the
>>> content after the float down to come with it.
>>> 
>>> So I think my conclusion is, no, the float may move, but it
>>> does not take its content with it.
>> 
>> Good, thanks for responding. Could you word this into the spec if
>> everyone agrees, then?
>
> I'm not disagreeing, exactly, but I'm not sure. Doesn't this mean that
> floats can get out of order, if, say, a large left float moves to the
> next column, but a smaller left float that comes after it stays in the
> first column?

In my mind that would kind of violate rule #5 in
http://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#float-position

"The outer top of a floating box may not be higher than the outer top of
any block or floated box generated by an element earlier in the source
document."

-- 
---- Morten Stenshorne, developer, Opera Software ASA ----
------------------ http://www.opera.com/ -----------------
Received on Friday, 18 September 2015 18:37:23 UTC

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