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

[CSS21] Ambiguity in section 9.2.1.1 (anonymous block boxes)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 03 Sep 2009 16:33:06 -0400
Message-ID: <4AA02802.5090308@mit.edu>
To: www-style list <www-style@w3.org>
Section 9.2.1.1 has this to say:

 > When an inline box contains a block box, the inline box (and its
 > inline ancestors within the same line box) are broken around the
 > block. The line boxes before the break and after the break are
 > enclosed in anonymous boxes, and the block box becomes a sibling of
 > those anonymous boxes. When such an inline box is affected by
 > relative positioning, the relative positioning also affects the
 > block box.

In that last sentence, it's not clear which box "the block box" refers 
to.  In Gecko, it was interpreted to be the box contained by the inline 
(which is the only "block box" discussed as such in this section).

In Opera and Webkit it seems to have been interpreted to mean the two 
anonymous boxes wrapped around the inline.  Or something.  It's not 
clear that the behavior in Opera and Webkit can be told apart from not 
applying the relative positioning to anything to any block boxes at all.

IE's behavior seems to match Gecko's (including what looks like a bug in 
both to me).

What is this section _trying_ to say?

Testcase:

<!DOCTYPE html>
<html>
   <body>
     <span style="position: relative; left: 100px">
       xxx
       <span style="display: block">
         aaa
       </span>
       <span style="float: left">bbb</span>
       <span style="display: block">
         ccc
       </span>
       yyy
     </span>
   </body>
</html>

I would expect this to render somewhat like so in Gecko once the bug I 
mention is fixed:

         xxx
         aaa
bbb        ccc
         yyy

The IE rendering (and current Gecko rendering) is:


         xxx
         aaa
         bbbccc
         yyy

The Opera/Webkit rendering is:

         xxx
aaa
bbbccc
         yyy

-Boris
Received on Thursday, 3 September 2009 20:33:51 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:20 GMT