Support surrogate pair when cropping XUL label.

RESOLVED DUPLICATE of bug 1164759

Status

()

RESOLVED DUPLICATE of bug 1164759
2 years ago
2 years ago

People

(Reporter: arai, Assigned: arai)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox49 affected)

Details

Attachments

(1 attachment)

(Assignee)

Description

2 years ago
Created attachment 8759723 [details]
long title with emoji

Currently surrogate pair is totally ignored when cropping text in XUL element.
This results in broken title in Tab, when it crops title text at the middle of surrogate pair.

We should support it, as webpages could use emoji in their title, and in most case Tab cannot show entire title.

----

Testcase A (Tab title)

1. open attached HTML
2. add and remove other tabs

Actual result:

sometimes emoji is shown and sometimes box with code is shown

Expected result:

always emoji is shown

----

Testcase B (all crop variants):

1. evaluate the following code in Scratchpad, with Browser environment.
   it adds 3 labels at the bottom of the browser window

  var w =  Services.wm.getMostRecentWindow("navigator:browser");

  var l = w.document.createElement("label");
  l.setAttribute("value",  ("\uD83D\uDC38\uD83C\uDF40\uD83D\uDC9A").repeat(20));
  l.setAttribute("crop", "start");
  w.document.documentElement.appendChild(l);

  l = l.cloneNode(false);
  l.setAttribute("crop", "end");
  w.document.documentElement.appendChild(l);

  l = l.cloneNode(false);
  l.setAttribute("crop", "center");
  w.document.documentElement.appendChild(l);

2. resize the browser window gradually to make those labels cropped


Actual result:

sometimes emoji is shown and sometimes box with code is shown


Expected result:

always emoji is shown
There's already a patch for this in bug 1164759. It works but the test doesn't.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1164759
You need to log in before you can comment on or make changes to this bug.