summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/rendering/break_lines.cpp
diff options
context:
space:
mode:
authorclaireho <chinglanho@gmail.com>2012-05-11 14:13:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-11 14:13:08 -0700
commitbe16d66d673ed469bbc744af8b4cd99210cbabc3 (patch)
tree11957048a7b3d265dd532c1436b3a834536d6f03 /Source/WebCore/rendering/break_lines.cpp
parent8391ddb06a5b36834e8bafb36763d792c1602ace (diff)
parent1be479d1603f2e8aefe28c2ef33dbc7f227dca30 (diff)
downloadexternal_webkit-be16d66d673ed469bbc744af8b4cd99210cbabc3.zip
external_webkit-be16d66d673ed469bbc744af8b4cd99210cbabc3.tar.gz
external_webkit-be16d66d673ed469bbc744af8b4cd99210cbabc3.tar.bz2
Merge "Cherry pick fixes for b/6388728 to jb-dev. DO NOT MERGE" into jb-dev
Diffstat (limited to 'Source/WebCore/rendering/break_lines.cpp')
-rw-r--r--Source/WebCore/rendering/break_lines.cpp32
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)