Description
CSS Display says
Boxes are assigned the same styles as their generating element, unless otherwise indicated.
In my opinion this is a bad default. In fact there is no case in which an element generates multiple boxes and the styles are assigned to all of them. Currently I think only the following cases (*) generate multiple boxes:
-
display: block ruby
generates a principal block box which contains an additionally-generated ruby container. As specified in CSS Ruby, the element styles are only assigned to the principal box. The ruby container inherits from the principal box (i.e. through the box tree parentage). -
A
table
inner display type generates a principal block container which contains an additionally-generated table box. Some properties are assigned to the principal box and some to the table box (this is a mess), but as far as I know no property is assigned to both. -
The
list-item
keyword generates an additional marker box. In fact I'm opposed to this case, I think the marker box should not be generated by the element, instead it should be a principal box generated by the::marker
pseudo-element originated by the element, but this is not what CSS Display says now. Anyways, according to CSS Pseudo, the element styles are not assigned to the marker box.
I think the block ruby
behavior would be a much better default, that is:
- The principal box (if any) is assigned the same styles as their generating element, unless otherwise indicated.
- Additionally-generated boxes and anonymous boxes inherit through their box tree parentage, unless otherwise indicated.
(*) There is also the case of inline elements with a block-level descendant, which should be clarified in #1604.