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

Re: [CSS2.1] Yet another white-space issue with anonymous table objects

From: Michael Jansson <mjan@em2-solutions.com>
Date: Mon, 09 Mar 2009 23:06:03 +0100
Message-ID: <49B592CB.5030201@em2-solutions.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: www-style list <www-style@w3.org>
Boris Zbarsky wrote:
> Michael Jansson wrote:
>>     * My first assumption is that the space between the DIVs would
>>       reside in an an anonymous block.
>
> Yes.  This is explicitly covered by section 9.2.1.1 of CSS 2.1.
>
>>     * Second assumption, SGM section 7.6.1 states that leading and
>>       trailing blanks should be removed in this block, so the anonymous
>>       block should in fact be treated as an empty anonymous block 
>> element.
>
> I'm not sure what "SGM section 7.6.1" is, but section 16.6.1 of CSS2.1 
> gives the same effect.
Sorry, I was referring to SGML as the foundation for both XML and HTML. 
It describes how spaces are handled in general (not just in blocks or 
inlines). I believe a valid XML parser should handle the space before 
any white space processing is done in accordance with section 16.6.1 of 
CSS 2.1.
>
>>     * Third assumption is that empty anonymous block elements should not
>>       be rendered (does not have a margin, padding, etc) and should thus
>>       not affect rendering of any sibling elements.
>
> This assumption seems to have no basis in the CSS2.1 specification.  
> If this is the desired behavior, then it needs to be actually 
> specified somewhere, explicitly.
The anonymous block would not contain any elements, since the white 
space would be removed. Without content and since margin, padding, 
border etc are not inherited, the block would not be able to have any 
size. Without content and size, one could argue that it should be safe 
for a UA to remove it (or never create it in the first place). Still, it 
would indeed be good if this was expressed in the spec.
>
> But even if I grant this assumption, this brings us to a slightly 
> different testcase:
>
> <!DOCTYPE html>
> <html>
>   <body>
>     <div style="display: table-cell">A</div>
>     <div style="position: absolute"></div>
>     <div style="display: table-cell">B</div>
>   </body>
> <html>
>
> In this case, the way CSS2.1 is written right now, are the two 
> table-cell boxes are sibling boxes (since the positioned div is taken 
> out of flow)?  If not, how is this situation different from the one 
> with the empty anonymous block above?
There is no reason for having the absolutely positioned div between the 
other two divs, so I guess you could argue that there is no reason for 
supporting such constructs. From an XML point of view, the two cases 
would be different.
>
> Perhaps the real issue here is the term "sibling" as used in 
> discussing anonymous boxes of various sorts, is never defined.  
> Further, the creation of the box model from the DOM tree is either 
> quite underspecified (including various unstated rules like the one 
> for empty anonymous blocks suggested above) or quite different from 
> what section 17.2.1 expects if taken at face value.
Good points!
>
> -Boris
>
Received on Monday, 9 March 2009 22:07:01 GMT

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