Skip to content

[css-inline-3] initial-letters changing used, not computed font-size #4988

Open
@faceless2

Description

@faceless2

An element used for initial-letters will have its used font-size adjusted based on the algorithm specified in css-inline-3. However its computed font size remains unchanged.

This is a problem for any child of the "initial-letters" element that refers to the parent font size as part of a style property - for example, if a child sets font-size: 0.5em, it will be 50% of the font-size the parent would have been, had it not been an initial-letter.

<p style="font-size: 20px; line-height: 1">
 <span style="initial-letters:3">
  A
  <span style="font-size: 0.5em; baseline-shift: 0.5em">
   B
  </span>
 </span>
</p>

The letter "A" has a computed font-size of 60px. The letter "B" has a font-size and baseline-shift of 10px, instead of the 30px an author would expect. Anyone creating superscript text as part of an initial letter would encounter this issue.

This issue is migrated from item 6 in #4171. There was considerable discussion of this in the January 2020 F2F, which is listed in the minutes however no resolution was reached.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions