[css-inline] initial-letter appliance and inheritance · Issue #2184 · w3c/csswg-drafts (original) (raw)
initial-letter does not inherit and applies to
::first-letter
pseudo-elements and inline-level first child of a block container
The problem is that the inline-level first child box of a block container is the root inline box, which cannot be targeted using selectors.
If the definition refers to the first child in the element tree then that's a problem with display: contents
. And if you have <div><b><i>Text</i></b></div>
, it's not clear why initial-letter
applies to b
but not to i
.
In any case, since there is no inheritance, it's not clear what happens if you set initial-letter
both to that first child and to the block container's ::first-letter
, or to nested ::first-letter
s.
Instead, I think there are three reasonable possibilities:
initial-letter
only applies to block containers that establish an inline formatting context, and affects the initial letter of the block container. But note that often the block container that establishes the IFC is an anonymous one, soinitial-letter
should inherit.initial-letter
only applies to innermost::first-letter
pseudo-elements, but it inherits, so you can set it on a block-level, inline-level or::first-letter
parent box.initial-letter
only applies to innermost::first-letter
pseudo-elements. And that's all because it doesn't inherit.