Closed Bug 253143 Opened 20 years ago Closed 7 years ago

Letter spacing is applied to zero width characters (zwsp, zwj, zwnj)

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla60
Tracking Status
firefox60 --- fixed

People

(Reporter: mozilla, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(5 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7) Gecko/20040724 Firefox/0.9.1+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7) Gecko/20040724 Firefox/0.9.1+ Where a zero width space exists but there is no line-break, CSS letter-spacing is applied to the zero width space. Testcase follows. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Summary: Letter- spacing is applied to zero width spaces even when the line does not break → Letter spacing is applied to zero width spaces even when the line does not break
Opera 7.5 behaves the same. IE6 behaves as expected.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file Test case v2
Added another line (to the top) - a "control group" with no zero-width spaces. The second line should look like the first line. Failing that, the third line should look like the first line - it has negative word-spacing applied. The fourth line demonstrates that positive word-spacing also isn't applied to zero-width spaces.
Attachment #154392 - Attachment is obsolete: true
(In reply to comment #3) > Failing that, the third line > should look like the first line - it has negative word-spacing applied. The > fourth line demonstrates that positive word-spacing also isn't applied to > zero-width spaces. By the way, these bits are bug 253144.
Editing summary per duplicate bug.
Summary: Letter spacing is applied to zero width spaces even when the line does not break → Letter spacing is applied to zero width characters (zwsp, zwj, zwnj)
This used to work just fine in Firefox 3.6, but Firefox 4 beta 6 suffers from this bug again.
New testcase with actual sample words from German that were displayed fine in Firefox 3.6 on Mac OS but incorrectly on Firefox 4 Beta 7 (and 6).
I’m adding an updated testcase. It unifies the two existing testcases by testing all of the three characters mentioned in the title of this bug, removes extraneous tests of the word-spacing property, and uses modern HTML. In this testcase, only the test involving the zero‐width space character fails to display correctly in Firefox 34. The tests for the other two characters, zero‐width non‐joiner and zero‐width joiner, are displayed correctly. (So, apparently, this bug is 2⁄3s of the way fixed.) As for other browsers, Chrome 39 displays the entire testcase correctly, and Internet Explorer 11 fails the same test as Firefox. I’m on Windows 8.1, so the platform listed (x86 Windows XP) must be incorrect.
(In reply to Patrick Garies from comment #9) > In this testcase, only the test involving the zero‐width space character > fails to display correctly in Firefox 34. The tests for the other two > characters, zero‐width non‐joiner and zero‐width joiner, are displayed > correctly. (So, apparently, this bug is 2⁄3s of the way fixed.) > Not exactly, I think. Although zero‐width non‐joiner and zero‐width joiner don't contribute to letter-spacing they can still affect font selection (tested on FF36 Linux 64). As a result, texts contains zero‐width non‐joiner or zero‐width joiner may looks different from those contains none. On my computer, "Control"(without special chars) is displayed with font "Source Han Sans SC Normal", while "Test 2" is displayed with fonts "DejaVu Sans" + "Source Han Sans SC Normal", and "Test 3" is displayed with font "DejaVu Sans".
Blocks: css-text-3
Component: Layout → Layout: Text
OS: Windows XP → All
Hardware: x86 → All
This fixes the problem for the examples here, AFAICS, as well as for similar format characters (zero-width no-break space, word joiner).
Attachment #8953829 - Flags: review?(jwatt)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Attachment #8953829 - Flags: review?(jwatt) → review+
Attachment #8953830 - Flags: review?(jwatt) → review+
Thanks Jonathan et al for fixing this!
Flags: needinfo?(jwatt)
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/9162eefca30f Do not add letter-spacing after zero-width format controls such as ZWSP. r=jwatt https://hg.mozilla.org/integration/mozilla-inbound/rev/b81999f30c15 Add a web-platform reftest for letter-spacing in the presence of zero-width format controls. r=jwatt
Created web-platform-tests PR https://github.com/w3c/web-platform-tests/pull/9864 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla60
Thanks everyone for all your work on this over the years, particularly for expanding the scope to other affected characters. I'm especially impressed by how robust our standard process seems to be now for automated regression testing of web platform features. Great work everyone!
Thanks, Tobi and Greg. It's nice to seem some positive comments in bugzilla once in a while. :)
Flags: needinfo?(jwatt)
Checked letter-spacing in combination with ​ in Nightly - works :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: