diff options
author | Russell Brenner <russellbrenner@google.com> | 2011-11-14 15:43:02 -0800 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2011-11-15 10:43:16 -0800 |
commit | 469c7a77ed7557a04a0797ff8ca3e4335a1c1be0 (patch) | |
tree | 49eab26cc6d75e636666677d34dd1e2be77429e8 /Source/WebCore/platform | |
parent | 8301739277842d9b70d13b5224743cf6eb8234ab (diff) | |
download | external_webkit-469c7a77ed7557a04a0797ff8ca3e4335a1c1be0.zip external_webkit-469c7a77ed7557a04a0797ff8ca3e4335a1c1be0.tar.gz external_webkit-469c7a77ed7557a04a0797ff8ca3e4335a1c1be0.tar.bz2 |
Mask display of zero-width characters
Updated TextRunWalker::getNormalizedTextRun() to use newer Font API
handling both regular and zero width space characters.
Bug: 5436040
Change-Id: I534641d057c914d18582c0041e85b5df1b457bcc
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r-- | Source/WebCore/platform/graphics/android/FontAndroid.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/FontAndroid.cpp index 852413f..e100955 100644 --- a/Source/WebCore/platform/graphics/android/FontAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/FontAndroid.cpp @@ -52,6 +52,7 @@ #include <wtf/OwnPtr.h> #include <wtf/PassOwnArrayPtr.h> #include <wtf/PassOwnPtr.h> +#include <wtf/unicode/CharacterNames.h> #include <wtf/unicode/Unicode.h> #endif @@ -881,10 +882,14 @@ void TextRunWalker::normalizeSpacesAndMirrorChars(const UChar* source, bool rtl, UChar32 character; int nextPosition = position; U16_NEXT(source, nextPosition, length, character); + if (Font::treatAsSpace(character)) - character = ' '; + character = space; + else if (Font::treatAsZeroWidthSpace(character)) + character = zeroWidthSpace; else if (rtl) character = u_charMirror(character); + U16_APPEND(destination, position, length, character, error); ASSERT(!error); position = nextPosition; |