| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // Delimit every CJK character because these scripts do not delimit | 120 // Delimit every CJK character because these scripts do not delimit |
| 121 // words by spaces, and not delimiting hits the performance. | 121 // words by spaces, and not delimiting hits the performance. |
| 122 if (!m_textRun.is8Bit()) { | 122 if (!m_textRun.is8Bit()) { |
| 123 UChar32 ch; | 123 UChar32 ch; |
| 124 unsigned end = m_startIndex; | 124 unsigned end = m_startIndex; |
| 125 U16_NEXT(m_textRun.characters16(), end, length, ch); | 125 U16_NEXT(m_textRun.characters16(), end, length, ch); |
| 126 if (Character::isCJKIdeographOrSymbol(ch)) { | 126 if (Character::isCJKIdeographOrSymbol(ch)) { |
| 127 bool hasAnyScript = !Character::isCommonOrInheritedScript(ch); | 127 bool hasAnyScript = !Character::isCommonOrInheritedScript(ch); |
| 128 for (unsigned i = end; i < length; end = i) { | 128 for (unsigned i = end; i < length; end = i) { |
| 129 U16_NEXT(m_textRun.characters16(), i, length, ch); | 129 U16_NEXT(m_textRun.characters16(), i, length, ch); |
| 130 // ZWJ check in order not to split Emoji ZWJ sequences. | 130 // ZWJ and modifier check in order not to split those Emoji
sequences. |
| 131 if (U_GET_GC_MASK(ch) & (U_GC_M_MASK | U_GC_LM_MASK | U_GC_S
K_MASK) | 131 if (U_GET_GC_MASK(ch) & (U_GC_M_MASK | U_GC_LM_MASK | U_GC_S
K_MASK) |
| 132 || ch == zeroWidthJoinerCharacter) | 132 || ch == zeroWidthJoinerCharacter || Character::isModifi
er(ch)) |
| 133 continue; | 133 continue; |
| 134 // Avoid delimiting COMMON/INHERITED alone, which makes hard
er to | 134 // Avoid delimiting COMMON/INHERITED alone, which makes hard
er to |
| 135 // identify the script. | 135 // identify the script. |
| 136 if (Character::isCJKIdeographOrSymbol(ch)) { | 136 if (Character::isCJKIdeographOrSymbol(ch)) { |
| 137 if (Character::isCommonOrInheritedScript(ch)) | 137 if (Character::isCommonOrInheritedScript(ch)) |
| 138 continue; | 138 continue; |
| 139 if (!hasAnyScript) { | 139 if (!hasAnyScript) { |
| 140 hasAnyScript = true; | 140 hasAnyScript = true; |
| 141 continue; | 141 continue; |
| 142 } | 142 } |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 const Font* m_font; | 219 const Font* m_font; |
| 220 float m_widthSoFar; // Used only when allowTabs() | 220 float m_widthSoFar; // Used only when allowTabs() |
| 221 unsigned m_startIndex : 30; | 221 unsigned m_startIndex : 30; |
| 222 unsigned m_wordResultCachable : 1; | 222 unsigned m_wordResultCachable : 1; |
| 223 unsigned m_shapeByWord : 1; | 223 unsigned m_shapeByWord : 1; |
| 224 }; | 224 }; |
| 225 | 225 |
| 226 } // namespace blink | 226 } // namespace blink |
| 227 | 227 |
| 228 #endif // CachingWordShapeIterator_h | 228 #endif // CachingWordShapeIterator_h |
| OLD | NEW |