diff options
author | claireho <chinglanho@gmail.com> | 2012-04-30 10:21:14 -0700 |
---|---|---|
committer | claireho <chinglanho@gmail.com> | 2012-04-30 10:58:42 -0700 |
commit | a571e242f305463ffcb0a8680c750312ed04ea79 (patch) | |
tree | 65835b10ebb1869a6c57d2007a30b1a5001b37f6 | |
parent | f78f45e5afb06ade1556cd3f5cc9634532a90034 (diff) | |
download | external_webkit-a571e242f305463ffcb0a8680c750312ed04ea79.zip external_webkit-a571e242f305463ffcb0a8680c750312ed04ea79.tar.gz external_webkit-a571e242f305463ffcb0a8680c750312ed04ea79.tar.bz2 |
Remove the FIXME item in shouldBreakAfter() of break_line.cpp.
Bug: 6388728 - Improper line break of Japanese text
The FIXME item in shouldBreakAfter() is a temporary workaround for webkit bug #17411
due to Unicode5.0 does not define IdeographicComma(U+3001) and ideographicFullStop(U+3002)
as line breaks. However, shouldBreakAfter() hard coded these 2 codepoints should have a line
break regardless any other punctuation right after these 2 characters.
Now, Android is using ICU4.8.1 that is against on Unicode6.0. IdeographicComma and
ideographicFullStop are included in the external/icu4c/data/unidata/LineBreak.txt.
It is safe to remove this temporary workaround.
Change-Id: Ie419e5e785bd15eeebf4380237e1418f6a2474ea
-rw-r--r-- | Source/WebCore/rendering/break_lines.cpp | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/Source/WebCore/rendering/break_lines.cpp b/Source/WebCore/rendering/break_lines.cpp index 9ac3375..4dbf81b 100644 --- a/Source/WebCore/rendering/break_lines.cpp +++ b/Source/WebCore/rendering/break_lines.cpp @@ -119,29 +119,21 @@ COMPILE_ASSERT(WTF_ARRAY_LENGTH(asciiLineBreakTable) == asciiLineBreakTableLastC static inline bool shouldBreakAfter(UChar ch, UChar nextCh) { - switch (ch) { - case ideographicComma: - case ideographicFullStop: - // FIXME: cases for ideographicComma and ideographicFullStop are a workaround for an issue in Unicode 5.0 - // which is likely to be resolved in Unicode 5.1 <http://bugs.webkit.org/show_bug.cgi?id=17411>. - // We may want to remove or conditionalize this workaround at some point. #ifdef ANDROID_LAYOUT - // as '/' is used in uri which is always long, we would like to break it - case '/': -#endif + if (ch == '/') // as '/' is used in uri which is always long, we would like to break it return true; - default: - // If both ch and nextCh are ASCII characters, use a lookup table for enhanced speed and for compatibility - // with other browsers (see comments for asciiLineBreakTable for details). - if (ch >= asciiLineBreakTableFirstChar && ch <= asciiLineBreakTableLastChar - && nextCh >= asciiLineBreakTableFirstChar && nextCh <= asciiLineBreakTableLastChar) { - const unsigned char* tableRow = asciiLineBreakTable[ch - asciiLineBreakTableFirstChar]; - int nextChIndex = nextCh - asciiLineBreakTableFirstChar; - return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8)); - } - // Otherwise defer to the Unicode algorithm by returning false. - return false; +#endif + + // If both ch and nextCh are ASCII characters, use a lookup table for enhanced speed and for compatibility + // with other browsers (see comments for asciiLineBreakTable for details). + if (ch >= asciiLineBreakTableFirstChar && ch <= asciiLineBreakTableLastChar + && nextCh >= asciiLineBreakTableFirstChar && nextCh <= asciiLineBreakTableLastChar) { + const unsigned char* tableRow = asciiLineBreakTable[ch - asciiLineBreakTableFirstChar]; + int nextChIndex = nextCh - asciiLineBreakTableFirstChar; + return tableRow[nextChIndex / 8] & (1 << (nextChIndex % 8)); } + // Otherwise defer to the Unicode algorithm by returning false. + return false; } static inline bool needsLineBreakIterator(UChar ch) |