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

Re: Question about run-in and floats

From: Alan Gresley <alan@css-class.com>
Date: Fri, 15 Jan 2010 18:24:07 +1100
Message-ID: <4B501817.9040007@css-class.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: www-style list <www-style@w3.org>
Boris Zbarsky wrote:
> Consider the following testcase:
> <!DOCTYPE html>
> <body>
>   <span style="display:run-in">
>     <span style="float: left">Some text</span>
>   </span>
>   <div style="clear:both">More text</div>
> </body>
> What is the expected rendering?  I believe the agreed-on behavior for 
> the run-in here was that the run-in should run in and the containing 
> block for the float should be the div, but the section on 'clear' says:
>     The clearance of the generated box is set to the amount necessary
>     to place the top border edge below the bottom outer edge of any
>     right-floating and left-floating boxes that resulted from elements
>     earlier in the source document. [1]
> In this case the float is clearly resulting from "elements earlier in 
> the source document".
> How do we want to reconcile these two things?  It seems to me that the 
> definition of 'clear' needs to be modified, or the behavior of run-ins 
> needs to be changed to not run in if that would cause floats to float 
> out of them.
> -Boris
> [1] http://www.w3.org/TR/CSS21/visuren.html#flow-control

Interesting. Hard to test since I only have FF 3.6.5 (beta) which does 
not support run-in. The following test case shows diverging behavior 
between IE8, Opera 10 and Safari 4.0.4.


I would expect the clearing element to clear the float.

IE8 and Opera 10.10 shows the same with the clearing element clearing 
the float. The clearing element does not clear the float in Safari 4.0.4 
and shows missing content with the run-in element when it also contains 
an anonymous inline box before the float or after the float.

Safari 4.0.4 has the two bugs with float with auto width and inline 
content (anonymous inline box).



Alan http://css-class.com/
Received on Friday, 15 January 2010 07:24:47 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:42 UTC