diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-05 16:11:25 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-05 16:11:25 +0000 |
commit | 9ee3098cf2a21bcfb8d234617ad18c516f80fded (patch) | |
tree | 24f7acf25c642172cdf8161eeed381ddb7f2cd36 /ui/gfx/render_text_linux.cc | |
parent | 16d4a8f86aad818462dad4b35a1d3eaff61cd6ec (diff) | |
download | chromium_src-9ee3098cf2a21bcfb8d234617ad18c516f80fded.zip chromium_src-9ee3098cf2a21bcfb8d234617ad18c516f80fded.tar.gz chromium_src-9ee3098cf2a21bcfb8d234617ad18c516f80fded.tar.bz2 |
Improve RenderTextWin font fallback.
Don't use SCRIPT_UNDEFINED in the case of font fallback,
unless font fallback actually fails to return a script
that can display the characters. This fixes the problem
of some scripts not being properly displayed.
This actually makes RenderTextWin properly validate whether
a text position accepts a cursor, which caused several tests
to fail and revealed some additional issues in RenderTextWin.
The CL includes some modifications to address this.
Also, fixes some lint warnings.
BUG=90426
TEST=Run chrome.exe --use-pure-views and paste some Bengali
text into the omnibox. It should show up properly.
Review URL: http://codereview.chromium.org/8575020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text_linux.cc')
-rw-r--r-- | ui/gfx/render_text_linux.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc index e2f0d67..2777006 100644 --- a/ui/gfx/render_text_linux.cc +++ b/ui/gfx/render_text_linux.cc @@ -284,6 +284,8 @@ void RenderTextLinux::DrawVisualText(Canvas* canvas) { } size_t RenderTextLinux::IndexOfAdjacentGrapheme(size_t index, bool next) { + if (index > text().length()) + return text().length(); EnsureLayout(); return Utf16IndexOfAdjacentGrapheme(Utf16IndexToUtf8Index(index), next); } |