Skip to content

[css-text] Make ::first-letter { text-transform: capitalize } a no-op for text in languages that don't have letter case #2135

@amire80

Description

@amire80

Consider the following code:

<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>first-letter issue demo</title>
  <style type="text/css">
    .cap::first-letter {
      text-transform: capitalize;
    }
  </style>
</head>

<body>
<div dir="rtl" lang="ar">
<p dir="ltr" lang="en">Incorrect, with capitalize:</p>
<p class="cap">عائلة</p>
<p dir="ltr" lang="en">Correct, without capitalize:</p>
<p>عائلة</p>
</div>
</body>
</html>

In the latest versions of Firefox and Chrome the rendering of the Arabic text in the section marked as "incorrect" is broken: the first letter is disconnected from the rest of the word. I guess that the rendering engines try to apply separate styling to the first letter and disconnect it, which is unnecessary because capitalization cannot work anyway.

While "first-letter" may have some useful meaning in all writing systems, "capitalize" is meaningless in writing systems that don't have letter case. Applying these rules to text in these writing systems should do nothing. I'm not sure how exactly this is supposed to be written, but this should be defined explicitly as a no-operation on the standards level.

The relevant standards section is probably
https://www.w3.org/TR/css-text-3/#text-transform-property

See the related discussion at https://lists.w3.org/Archives/Public/www-international/2017OctDec/0142.html

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions