Bug 6014 - Bidi algorithm: incorrect resolved levels for neutrals between R and ET ON L
Summary: Bidi algorithm: incorrect resolved levels for neutrals between R and ET ON L
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-08 13:43 PST by mitz
Modified: 2005-12-18 08:18 PST (History)
0 users

See Also:


Attachments
testcase (1.02 KB, text/html)
2005-12-08 13:44 PST, mitz
no flags Details
Keep track of the last position before the current run of ETs directly (12.70 KB, patch)
2005-12-08 15:56 PST, mitz
darin: 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-12-08 13:43:03 PST
When the embedding direction is LTR, the sequence
R  neutrals ET neutrals L
should resolve to
R  L        L  L         L
but in TOT it resolves to
R  R        L  L        L.

This is the first example In the attached testcase:
R  WS ON WS ON WS ET ET WS L
resolves to
R  R  R  R  R  R  L  L  L  L.
Firefox handles it correctly.

This happens due to the special way ETs are treated just in case they end up prefixing an EN. The idea 
in the patch for bug 3733 was to use bidi.eor to mark the last position before the first ET (need to know 
this position when deciding what goes with the EN), but for the other cases it introduced an eor in the 
middle of the neutrals, guessing that the neutrals will need to end up as R (setting bidi.status.eor to R). 
This guess turns out to be wrong in the first example in the testcase.

While it might be possible to fix this by not guessing at all (setting bidi.status.eor to ON), this will 
require special treatment of this case (status.eor==ON) in all places that check status.eor (currently 
there are asserts that status.eor!=ON). A simpler and clearer solution is to add a bidi.lastET member for 
the exclusive use of the ET and EN-after-ET cases.
Comment 1 mitz 2005-12-08 13:44:21 PST
Created attachment 5003 [details]
testcase
Comment 2 mitz 2005-12-08 15:56:48 PST
Created attachment 5007 [details]
Keep track of the last position before the current run of ETs directly

This even shortens bidi.cpp by a few lines!
Comment 3 Darin Adler 2005-12-09 19:19:02 PST
Comment on attachment 5007 [details]
Keep track of the last position before the current run of ETs directly

Not that I fully understand this, but r=me.