Bug 3545 - Incorrect reordering and mirroring in visually-ordered Hebrew
Summary: Incorrect reordering and mirroring in visually-ordered Hebrew
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 412
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Richard Williamson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-15 09:06 PDT by mitz
Modified: 2005-11-04 00:29 PST (History)
0 users

See Also:


Attachments
testcase (411 bytes, text/html)
2005-06-15 09:08 PDT, mitz
no flags Details
actual rendering (1.66 KB, image/png)
2005-06-15 09:09 PDT, mitz
no flags Details
expected rendering (1.63 KB, image/png)
2005-06-15 09:10 PDT, mitz
no flags Details
Proposed patch (1.99 KB, patch)
2005-06-15 09:25 PDT, mitz
rjw: review+
Details | Formatted Diff | Diff
revised patch (2.30 KB, patch)
2005-06-16 23:24 PDT, mitz
rjw: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2005-06-15 09:06:56 PDT
Summary: Under certain conditions, reordering of the letters or Unicode mirroring occurs in visually-
ordered Hebrew, instead of plain left-to-right ordering and no mirroring.

To reproduce:
Open the testcase in Safari and in Firefox

Expected:
Safari should render it like Firefox does (that is, characters should be rendered from left to right 
unchanged and in the order in which they appear in the source).

Actual:
Line 1: the full stop (.) and Hebrew letter Bet are rendered in the wrong order.
Line 2: the left parenthesis is rendered as a right parenthesis.
Line 3: the letter a and the Hebrew letter Aleph are rendered in the wrong order.
Line 4: there is no space between the hyphen-minus (-) and the Hebrew letter Aleph.

See screenshots for expected and actual.

Analysis: Currently visual ordering is accomplished by reversing the order of characters prior to 
drawing, assuming ATSUI will re-reverse. The problem is that sometimes ATSUI's transformation is not 
as trivial, and includes more complex reordering and mirroring.

The proposed patch accomplishes visual ordering by enclosing the text between Unicode LRO and PDF 
characters instead of reversing it. The LRO effectively tells ATSUI not to do any re-ordering or mirroring 
but just render visually from left to right.

Since this is a rendering-only (not layout) bug, there's no layout test.
Comment 1 mitz 2005-06-15 09:08:06 PDT
Created attachment 2362 [details]
testcase
Comment 2 mitz 2005-06-15 09:09:36 PDT
Created attachment 2363 [details]
actual rendering
Comment 3 mitz 2005-06-15 09:10:08 PDT
Created attachment 2364 [details]
expected rendering
Comment 4 mitz 2005-06-15 09:25:05 PDT
Created attachment 2366 [details]
Proposed patch
Comment 5 Nicholas Shanks 2005-06-15 10:01:20 PDT
With the current ToT, not having applied this patch, I see line 2 rendered correctly not as shown or 
described above.
Comment 6 mitz 2005-06-15 10:16:21 PDT
(In reply to comment #5)
> With the current ToT, not having applied this patch, I see line 2 rendered correctly not as shown or 
> described above.

Could this be due to the ATSUI issue mentioned in <http://bugzilla.opendarwin.org/show_bug.cgi?
id=3435#c6>? I took the screenshot with the Standard font set to Lucida Grande 14. 
Comment 7 Richard Williamson 2005-06-16 16:11:16 PDT
Comment on attachment 2366 [details]
Proposed patch

Looks good.  It would be better to replace 0x202D and 0x202C with a #define.
Comment 8 mitz 2005-06-16 23:24:30 PDT
Created attachment 2417 [details]
revised patch

Replaced 0x202C and 0x202D with a #define as suggested by rjw.
Comment 9 Richard Williamson 2005-06-17 10:13:36 PDT
Comment on attachment 2417 [details]
revised patch

Good to go.  I'll commit.  Thanks Mitz.
Comment 10 Chris Petersen 2005-06-18 23:13:48 PDT
Reporter, please mark this bug as Verified if this issue has been fixed in the latest TOT Webkit.