Bug 14684

Summary: Hebrew text in Safari chrome is reversed (LTR instead of RTL)
Product: WebKit Reporter: mitz
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben
Priority: P1 Keywords: InRadar
Version: 523.x (Safari 3)   
Hardware: PC   
OS: Windows XP   
Bug Depends on: 14626    
Bug Blocks:    
Attachments:
Description Flags
Test case
none
More bidi string rendering tests (and bugs)
none
[WIP] Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls
none
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls
darin: review+
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls darin: review+

Description mitz 2007-07-20 00:08:41 PDT
Hebrew text in Safari chrome is laid out in left-to-right order instead of right-to-left. This can be seen in window title bars, bookmark menu items, and the address bar and search fields when they are not focused.
Comment 1 mitz 2007-07-20 00:11:37 PDT
Created attachment 15591 [details]
Test case
Comment 2 mitz 2007-07-20 00:12:07 PDT
Also affected are link drag images and tab titles.
Comment 3 Adam Roben (:aroben) 2007-07-20 00:34:24 PDT
<rdar://problem/5267753>
Comment 4 mitz 2007-07-20 16:21:31 PDT
Created attachment 15610 [details]
More bidi string rendering tests (and bugs)

Reordering characters is not enough, as demonstrated by the way list items render on this test: mirroring and combining marks need to be handled. Since the Font object already knows how to do that for unidirectional runs, I think the bidirectional string drawing routine should not reorder characters and feed one string into Font::drawText, but rather draw separate truly-unidirectional runs.
Comment 5 mitz 2007-07-21 05:54:45 PDT
Created attachment 15611 [details]
[WIP] Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls
Comment 6 mitz 2007-07-22 07:01:07 PDT
Created attachment 15620 [details]
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls
Comment 7 Darin Adler 2007-07-22 08:44:15 PDT
Comment on attachment 15620 [details]
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls

r=me

I would like the change log to explain better why the visual ordering test cases are removed. I think I understand, but I'm not sure.
Comment 8 Adam Roben (:aroben) 2007-07-22 12:23:52 PDT
Comment on attachment 15620 [details]
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls

Index: WebCore/manual-tests/resources/chrome-bidi-text-window.html
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: WebCore/manual-tests/resources/chrome-bidi-text-window.html
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream


I don't think this was intentional? Whoever commits this should fix this first!
Comment 9 mitz 2007-07-22 12:47:14 PDT
(In reply to comment #8)
> I don't think this was intentional? Whoever commits this should fix this first!

That file is encoded as UTF-16. I think it is more readable that way than using entities for all the non-Latin characters.
Comment 10 mitz 2007-07-23 10:25:03 PDT
Created attachment 15650 [details]
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls

Changed the manual test case to UTF-8 and added info to the change log about why -webkit-rtl-ordering:visual is being ignored.
Comment 11 Darin Adler 2007-07-23 10:29:06 PDT
Comment on attachment 15650 [details]
Add GraphicsContext::drawBidiText() and use it in WebCoreTextRenderer.cpp and in form controls

r=me
Comment 12 Mark Rowe (bdash) 2007-07-24 02:59:08 PDT
Landed in r24582.