Weird HTML entities behavior in document title when shown in window/tab title

NEW
Unassigned

Status

()

4 years ago
4 years ago

People

(Reporter: nicolas, Unassigned)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

4 years ago
Created attachment 8551521 [details]
Capture d’écran 2015-01-20 à 00.41.45.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150108202552

Steps to reproduce:

On Firefox 35 on a Mac OS X 10.9.5

I used HTML entities in a document <title>, see attached HTML file.


Actual results:

The same entity (&#10084;) gave two different renderings, a black heart and a red heart. See attached screenshot.

The same happens in both Chrome and Safari.


Expected results:

The same rendering should have been used for both hearts.
(Reporter)

Comment 1

4 years ago
Created attachment 8551522 [details]
entities-title-test.html
(Reporter)

Comment 2

4 years ago
It seems there's a difference when the entity is following a space or not.

Try both "&#10084;&#128077;&#10084; &#10084; &#128077; &#10084;" and "&#10084;&#128077; &#10084; &#10084; &#128077; &#10084;" and look at the second heart (third entity).

HTH

Updated

4 years ago
Component: Untriaged → Graphics: Text
Product: Firefox → Core
Doesn't look like a graphics issue.
Component: Graphics: Text → Layout: Text
Confirming, but I'm fairly sure this is a bug in OSX. Try saving the testcase with ❤
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: 35 Branch → Trunk
Sorry, I keep forgetting that bugzilla has a bug with supplementary characters in comments.  Try saving the testcase with the characters from the <title> as the filename and you will see the same inconsistency in Finder.
This is a result of how our font fallback works (and apparently OS X is doing something similar), when the symbols aren't present in the main font being used. Fallback generally tries to use the same font as the preceding character (to reduce the potential "ransom-note" effect); but in this case, this results in the second of the hearts using the Apple Color Emoji font, because of the preceding emoji character, while the first heart used a standard symbol font.

I'm pretty sure there's an existing bug report that covers this... let's see if I can find it.
Oh, and this isn't specific to titles; the same effect can occur within HTML content. With typical font settings, you can see it with a minimal example such as

  data:text/html,&%23x2764;&%23x1f44d;&%23x2764;
See bug 1066933 for a closely-related issue; not an exact duplicate of this example, but the underlying cause is the same, I suspect.
You need to log in before you can comment on or make changes to this bug.