[csswg-drafts] [css-display] Element styles should only be assigned to the principal box by default

Loirooriol has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-display] Element styles should only be assigned to the principal box by default ==
[CSS Display](https://drafts.csswg.org/css-display-3/#intro) 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](https://drafts.csswg.org/css-ruby-1/#block-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](https://drafts.csswg.org/css-pseudo-4/#treelike), 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.


Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1702 using your GitHub account

Received on Monday, 7 August 2017 12:16:03 UTC