Incorrect letter-spacing on emoji character when used with text-transform

RESOLVED FIXED in Firefox 62

Status

()

defect
P3
normal
RESOLVED FIXED
11 months ago
11 months ago

People

(Reporter: davidhong.code, Assigned: jfkthame)

Tracking

({regression})

15 Branch
mozilla62
Points:
---

Firefox Tracking Flags

(firefox-esr52 wontfix, firefox-esr60 wontfix, firefox60 wontfix, firefox61 wontfix, firefox62 fixed)

Details

Attachments

(3 attachments)

(Reporter)

Description

11 months ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0
Build ID: 20180517141400

Steps to reproduce:

When presented with the follow

```html
<h1 class="ls u">S
(Reporter)

Comment 1

11 months ago
Not sure why bug details have been cut off but here it is again:

```
<h1>S
(Reporter)

Comment 2

11 months ago
Not sure why this interface is cutting off my markdown.. even when preview shows correctly.

Here's the relevant codepen link: https://codepen.io/anon/pen/qYgXbj

Comment 3

11 months ago
Regression window:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2db9df42823d&tochange=9ebf3dc839c5

Suspect: Bug 307039

@Jonathan Kew
Your bunch of patch seems to cause the issue, Can you please look into this issue?
Blocks: 307039
Status: UNCONFIRMED → NEW
Component: Untriaged → Layout: Text
Ever confirmed: true
Flags: needinfo?(jfkthame)
Keywords: regression
Product: Firefox → Core
Version: 61 Branch → 15 Branch
(Assignee)

Comment 4

11 months ago
I notice that in the example with letter-spacing and text-transform, it's also possible to select the regional-indicator flag (and following letter-spacing gap) as two distinct pieces; copying the first one results in a single unpaired surrogate, while the second results in three surrogates (the trailing part of the first RI character, plus the entire second character).

We should obviously be keeping that whole cluster firmly glued together so that letter-spacing and selection always apply to it as a single unit.
Flags: needinfo?(jfkthame)
(Assignee)

Comment 5

11 months ago
This isn't limited to emoji regional-indicator flags, either. A similar problem occurs with any supplementary-plane characters, such as Deseret:

data:text/html;charset=utf-8,<p style="letter-spacing:10px;text-transform:lowercase">%F0%90%90%B1%F0%90%90%B2%F0%90%90%B3%F0%90%90%B4%F0%90%90%B5</p>

Here, the text is lowercase anyway, so the text-transform should have no visible effect; but in fact it causes the letter-spacing to be (incorrectly) increased.

And the emoji-ZWJ sequences such as various family groups exhibit the same problem:

data:text/html;charset=utf-8,<p style="letter-spacing:10px;text-transform:lowercase">%F0%9F%91%A8%E2%80%8D%F0%9F%91%A9%E2%80%8D%F0%9F%91%A7%F0%9F%91%A9%E2%80%8D%F0%9F%91%A7%E2%80%8D%F0%9F%91%A6</p>
(Assignee)

Updated

11 months ago
Priority: -- → P3
(Assignee)

Updated

11 months ago
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
(Assignee)

Updated

11 months ago
Attachment #8979309 - Flags: review?(m_kato)
(Assignee)

Updated

11 months ago
Attachment #8979308 - Flags: review?(m_kato)

Comment 8

11 months ago
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/93de67c96d9d
Don't allow letter-spacing or cursor placement within a merged group of glyph records in a transformed textrun. r=m_kato
https://hg.mozilla.org/integration/mozilla-inbound/rev/36b8909f5a19
Reftests for combination of letter-spacing and text-transform with supplementary-plane characters. r=m_kato

Comment 9

11 months ago
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a49aedba4668
followup, mark test as failing on Android due to lack of font support. r=me

Comment 10

11 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/93de67c96d9d
https://hg.mozilla.org/mozilla-central/rev/36b8909f5a19
https://hg.mozilla.org/mozilla-central/rev/a49aedba4668
Status: ASSIGNED → RESOLVED
Last Resolved: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.