Summary: | Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs. | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | bitigchi | ||||||||||
Component: | Text | Assignee: | Darin Adler <darin> | ||||||||||
Status: | RESOLVED FIXED | ||||||||||||
Severity: | Normal | CC: | ap, bitigchi, commit-queue, darin, esprehn+autocc, glenn, gyuyoung.kim, kondapallykalyan, mitz, mmaxfield, rakuco, ryuan.choi, sergio, webkit-bug-importer | ||||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||||
Hardware: | Unspecified | ||||||||||||
OS: | All | ||||||||||||
Attachments: |
|
Description
bitigchi
2011-10-13 08:59:53 PDT
Created attachment 110854 [details]
Safari: Not rendered correctly
Created attachment 110856 [details]
Firefox: Rendered correctly
Although the font is different here, it is clear that the letters of the Safari screenshot here are right aligned on the first line.
InlineIterator operates on UTF-16 code units rather than on characters. Since Old Turkic is encoded using surrogate pairs, InlineIterator::direction() incorrectly returns LeftToRight (for each of the two surrogates) instead of RightToLeft. This is a very annoying bug. Is there any info on when this can be fixed? !Ping! Created attachment 238440 [details]
Patch
Mitz asked me to look at this bug, so I did. Patch isn’t ready to land because we need some regression tests; we need to write tests that don’t require installing a font. Also need to measure performance to see if I slowed things down. Comment on attachment 238440 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238440&action=review > Source/WebCore/rendering/InlineIterator.h:436 > + if (LIKELY(U16_IS_SINGLE(codeUnit))) > + return u_charDirection(codeUnit); If this code path is really hot, then we should have a faster patch so we don't have to call into u_charDirection for common characters. (In reply to comment #8) > Mitz asked me to look at this bug, so I did. Patch isn’t ready to land because we need some regression tests; we need to write tests that don’t require installing a font. Great news anyway! Thank you very much! Created attachment 238599 [details]
Patch
Committed r173943: <http://trac.webkit.org/changeset/173943> Just for info, has this landed on a Safari release yet? I don't have an OS X machine at the moment, just wanted to check. Thanks in advance. |