Chromium Code Reviews
Description
This change list fix issue 5926 -- RTL: Text in [New Tab] should be truncated from RightToLeft instead of LeftToRight.
(http://crbug.com/5926)
Basically, the issue is that in RTL locales, the thumbnail title etc. text will always be truncated from left, even if they are pure English. For example, "mail.yahoo.com" whose title is "Yahoo! the best web based email!" will be truncated to "best web-based email!".
We should be able to truncate the title as "Yahoo! the be...".
The fix is to set the direction style of each title in the [New Tab] html page for title to be displayed and truncated correctly.
The fix consists 2 part: new_tab_ui.cc in backend and new_tab.html in frontend.
1. new_tab_ui.cc
For thumbnail title, recent bookmark title, and recently closed tab titles, originally, we set "title" and "url" into the data we pass to JS in new_tab.html. The fix added the title's "direction" to the data. The direction is by default "ltr" and is set as "rtl" when there is character having strong directionality in the title.
2. new_tab.html
2.1 set text-alignment in thumbnail-title, bookmark container, and recently closed container to be "right" for RTL locales.
2.2 explicitly set title's directionality in the above 3 sections.
Test:
1. open Chrome in RTL locales.
2. open the following pages:
http://yahoo.com
http://gmail.com
http://mail.yahoo.com
http://wikipedia.com
http://msdn.microsoft.com/en-us/default.aspx
http://arabic.arabia.msn.com/default.aspx
http://he.wikipedia.org/
3. bookmark, close some of them.
4. open [New Tab]
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=9129
Patch Set 1 #
Total comments: 5
Patch Set 2 : '' #Patch Set 3 : '' #
Total comments: 5
Patch Set 4 : '' #
Total comments: 7
Patch Set 5 : '' #Patch Set 6 : '' #Messages
Total messages: 13 (0 generated)
|