You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-display] Element styles should only be assigned to the principal box by default #1702
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.
As part of fixing #1643 in b2d484c, we ended up tightening up the language here too:
A box is assigned the same styles as its generating [=CSS/element=], unless otherwise indicated.
In general, inherited properties are assigned to the principal box,
and then inherit through the box tree
to any other boxes generated by the same element.
Non-inherited properties default to applying to the principal box,
but when the element generates multiple boxes,
are sometimes defined to apply to a different box:
for example, the 'border' properties applied to a table element
are applied to its table grid box,
not to its principal table wrapper box
Activity
tabatkins commentedon Mar 19, 2018
As part of fixing #1643 in b2d484c, we ended up tightening up the language here too: