Last Comment Bug 553571 - SInhala text with zero width non-joiner (ZWNJ) doesn't render as expected
: SInhala text with zero width non-joiner (ZWNJ) doesn't render as expected
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Jonathan Kew (:jfkthame)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-19 06:16 PDT by Harshana
Modified: 2011-06-30 23:59 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Issue is same with FF 3.6.13 (114.98 KB, image/png)
2011-02-01 22:25 PST, Harshana
no flags Details
with FF5 (164.62 KB, image/png)
2011-06-29 07:38 PDT, Harshana
no flags Details
patch, try to avoid breaking font runs at zwnj (3.45 KB, patch)
2011-06-30 05:02 PDT, Jonathan Kew (:jfkthame)
roc: review+
Details | Diff | Splinter Review

Description Harshana 2010-03-19 06:16:04 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1036 Safari/532.5
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 (.NET CLR 3.5.30729)

<html >
<head >

</head>

<body>
ඔෘ
<br />
ඔ‌ෘ 
</body>
</html>

Save the above to html File and Open it. the second line 2 letters should be show without o.


Reproducible: Always

Steps to Reproduce:
1.<html >
<head >

</head>

<body>
ඔෘ
<br />
ඔ‌ෘ 
</body>
</html>
2.Copy above to Html file.
3.Open it
Actual Results:  
it shows both as same in above sample.

Expected Results:  
First line should shows with o middle and second line is shouldn't show.
Comment 1 Harshana 2010-03-19 06:20:42 PDT
xpected Results:  
First line should shows with o (dotted circle (U+25CC)http://www.fileformat.info/info/unicode/char/25cc/index.htm) middle and second line is shouldn't show.
Comment 2 Tyler Downer [:Tyler] 2010-12-31 09:56:42 PST
Reporter, are you still seeing this issue with Firefox 3.6.13 or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles

You can also try to reproduce in Firefox 4 Beta 8 or later, there are many improvements in the new version, http://www.mozilla.com/en-US/firefox/all-beta.html
Comment 3 Tyler Downer [:Tyler] 2011-02-01 21:54:37 PST
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Comment 4 Harshana 2011-02-01 22:25:07 PST
Created attachment 509030 [details]
Issue is same with FF 3.6.13

Issue is same with FF 3.6.13 with new profile in Windows 7, I'll try to find user who uses XP too
Comment 5 Tim (fmdeveloper) 2011-06-26 15:32:37 PDT
Reporter -> Are you still experiencing this issue with the latest version of Firefox 5? Does the issue occur with the latest nightly? http://nightly.mozilla.org/
Comment 6 Harshana 2011-06-29 07:38:25 PDT
Created attachment 542818 [details]
with FF5

still the issue is there. see the attached picture with Google chrome
Comment 7 Jonathan Kew (:jfkthame) 2011-06-30 01:03:42 PDT
I think this may be a result of how font fallback currently operates. Does it fix the problem if you explicitly choose a Sinhala font for the relevant portion of the text? Try something like:

<body style="font-family: ">
ඔෘ
<br />
ඔ‌ෘ 
</body>
Comment 8 Jonathan Kew (:jfkthame) 2011-06-30 01:05:10 PDT
(In reply to comment #7)
> <body style="font-family: ">

Oops, that should have been

  <body style="font-family: 'Iskoola Pota'">

(or whatever Sinhala font you have available).
Comment 9 Harshana 2011-06-30 02:01:24 PDT
yeah, it is working when we put font family, but it is not practical.
Comment 10 Jonathan Kew (:jfkthame) 2011-06-30 02:35:05 PDT
(In reply to comment #9)
> yeah, it is working when we put font family, but it is not practical.

Right, but that helps confirm the cause of the problem. I'll look into a possible patch that I think could help.
Comment 11 Harshana 2011-06-30 02:36:24 PDT
(In reply to comment #10)
> (In reply to comment #9)
> > yeah, it is working when we put font family, but it is not practical.
> 
> Right, but that helps confirm the cause of the problem. I'll look into a
> possible patch that I think could help.

Thanks,
Comment 12 Jonathan Kew (:jfkthame) 2011-06-30 05:02:03 PDT
Created attachment 543105 [details] [diff] [review]
patch, try to avoid breaking font runs at zwnj

The problem arises because font fallback is likely to pick a different font for the ZWNJ character than for the surrounding Sinhala characters, and this breaks shaping behavior that depends on seeing the ZWNJ as part of the same run.

The patch fixes this by "propagating" the currently-chosen font from the preceding character to ZWNJ, where possible. We don't necessarily want to propagate it from ZWNJ to the _following_ character (like we do for ZWJ, for the sake of Arabic), as that has been known to cause problems in the past (bug 534919). In the cases where it actually matters, we'll pick the same font for the preceding and following Indic letters anyway, so all that's necessary is to ensure the ZWNJ matches one of these.

Pushed to tryserver with a reftest. I'm expecting the test to fail on (most?) non-Windows platforms, as it'll be dependent on font availability and quirks of shaping engine behavior - e.g., Core Text does not insert dotted circles for "ill-formed" character sequences in the same way the Windows shaping engines do. So the test is only expected to be reliably useful for Windows at this point; I'll mark it random on other platforms, but am just curious to see the actual results first.
Comment 13 Robert O'Callahan (:roc) (email my personal email if necessary) 2011-06-30 05:19:00 PDT
Comment on attachment 543105 [details] [diff] [review]
patch, try to avoid breaking font runs at zwnj

Review of attachment 543105 [details] [diff] [review]:
-----------------------------------------------------------------
Comment 14 Jonathan Kew (:jfkthame) 2011-06-30 23:59:49 PDT
http://hg.mozilla.org/mozilla-central/rev/9c848549aa3b

Note You need to log in before you can comment on or make changes to this bug.