Closed Bug 1613353 Opened 4 years ago Closed 4 years ago

CSS ::first-letter with text-transform uppercase renders element too wide

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 385615

People

(Reporter: peter, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36

Steps to reproduce:

Style the first-letter of an inline-block element with text-transform: uppercase.
https://codepen.io/peterwestendorp/pen/ExjYroE

Actual results:

The measurement (width) of the element came out wrong. It looks like the element got the width of the fully upper-cased text (HELLO WORLD).

Expected results:

I expected the element to be only as wide as the actual rendered text (Hello world).

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

Hi,

I have managed to reproduce this issue on latest FF release 72.0.2, Beta 73 and latest Nightly build 74.0a1 (2020-02-10) using Windows 10.
Further, I will move this over to a component so developers can take a look over it. If this is not the correct component please feel free to change it to an appropriate one.
The issue is not reproducible on Chrome.

Thanks for the report.

Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Text and Fonts
Ever confirmed: true
Product: Firefox → Core
Version: 72 Branch → Trunk

Yes, this is a longstanding bug in how ::first-letter behaves.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.