From 469c7a77ed7557a04a0797ff8ca3e4335a1c1be0 Mon Sep 17 00:00:00 2001 From: Russell Brenner Date: Mon, 14 Nov 2011 15:43:02 -0800 Subject: 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 --- Source/WebCore/platform/graphics/android/FontAndroid.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Source/WebCore') 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 #include #include +#include #include #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; -- cgit v1.1