Bug 6014

Summary: Bidi algorithm: incorrect resolved levels for neutrals between R and ET ON L
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase
none
Keep track of the last position before the current run of ETs directly darin: review+

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.