Closed Bug 1277894 Opened 8 years ago Closed 8 years ago

Support surrogate pair when cropping XUL label.

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1164759
Tracking Status
firefox49 --- affected

People

(Reporter: arai, Assigned: arai)

Details

Attachments

(1 file)

Attached file 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
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: