Re: [CSS21] Does the root element establish a root block formatting context?

L. David Baron wrote:
> When the root element is a block, it clearly participates in a block
> formatting context, as described in CSS 2.1 section 9.4:
>   # Boxes in the normal flow belong to a formatting context, which
>   # may be block or inline, but not both simultaneously. Block boxes
>   # participate in a block formatting context.


The root element (whatever that may be) generates a 'block formatting 
context' by default. The default is dir="ltr". In Direction 9.10 [1] 
we see this (edited for clarity).

   | This property specifies the base writing direction of blocks
   | and the direction of embeddings and overrides for the Unicode
   | bidirectional algorithm. In addition, it specifies the
   | direction of table column layout, the direction of horizontal
   | overflow, and the position of an incomplete last line in a
   | block in case of 'text-align: justify'.


The part "base writing direction of blocks" is in other words a 'block 
formatting context'.


> Section 9.4.1 describes which elements establish *new* block
> formatting contexts (i.e., block formatting contexts that are inside
> others), but it doesn't say whether the block formatting context
> that the root element participates in is established by the root
> element or by something above the root element (such as the canvas).


Agree, not very well defined. Much like 'root element', 'initial 
containing block' and block formatting context' in someways be 
describing the same thing.


> This matters because this affects whether the root element's height
> is computed using the rules in section 10.6.3 or the rules in
> section 10.6.7.  This difference in height is detectable using
> bottom-positioned background images, as reported in
> https://bugzilla.mozilla.org/show_bug.cgi?id=590491 .  The reporter
> of that bug states that Gecko expands the root element for floats
> (following the rules in 10.6.7) while Opera and WebKit do not
> (following the rules in 10.6.3).
> 
> -David


Gecko it seems has a problem when something is not present for the 
html element or an anonymous html element. In the linked series of 
test cases below, this is not giving html a background-color. Also 
this has something to do with it being HTML5. XML (traditional at 
least) does not show this problem.


<http://css-class.com/test/temp/root-bfc-icb1.htm>



1. <http://www.w3.org/TR/CSS21/visuren.html#propdef-direction>


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Friday, 27 August 2010 02:46:17 UTC