Re: [CSS21] Nested floats and zero-height margin box

On 21/05/2012 16:09, Øyvind Stenhaug wrote:
> On Mon, 21 May 2012 12:33:54 +0200, Anton Prowse <prowse@moonhenge.net>
> wrote:
>> On 25/02/2012 21:45, "Gérard Talbot" wrote:
>>> Bug 16119: [9.5.1 Floats] How nested floats with one zero-height
>>> margin box should be rendered
>>> https://www.w3.org/Bugs/Public/show_bug.cgi?id=16119
>
>> Perhaps there exist test cases which more clearly demonstrate a
>> problem with the lack of explicit definition of "next to". I can't
>> immediately think of any, though, and until some arise I propose
>> closing this bug as wontfix.
>
> <!DOCTYPE html>
> <style>
> body > div {
> width: 150px;
> }
> div > div {
> width: 100px;
> height: 100px;
> }
> .left {
> background: blue;
> float: left;
> }
> .right {
> background: teal;
> float: right;
> margin-bottom: -150px;
> }
> </style>
> <div>
> <div class="left"></div>
> <div class="right"></div>
> </div>
>
> These squares don't overlap (in Gecko/Presto/Webkit, at least, didn't
> try IE). That doesn't seem very obvious, since it seems to suggest
> different "next to"-conditions than the ones used for line boxes. Of
> course, it would be a bit weird for them to overlap since it would
> almost be like placing the later element's box "above" the earlier. (But
> not really - the vertical position would be equal, not above.)

Hmm, negative margins.  OK, this has some parallels with 
https://www.w3.org/Bugs/Public/show_bug.cgi?id=15389 .

OK, let's leave that existing bug as concerning the shrink-to-fit 
algorithm (and postponing to CSS3), and I'll create a new one for the 
need to define "next to" for floats, to be solved in parallel with the 
bug I just linked to.  (I suspect we'll just hand-wave it away somehow 
for CSS21, just as was tried – somewhat unsuccessfully, unfortunately – 
for that other bug.  CSS3 will probably be the place to sort all of this 
out.)

Cheers,
Anton Prowse
http://dev.moonhenge.net

Received on Monday, 21 May 2012 18:00:12 UTC