Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class PLATFORM_EXPORT Character { | 43 class PLATFORM_EXPORT Character { |
| 44 public: | 44 public: |
| 45 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp lePath; } | 45 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp lePath; } |
| 46 static CodePath characterRangeCodePath(const UChar*, unsigned len); | 46 static CodePath characterRangeCodePath(const UChar*, unsigned len); |
| 47 | 47 |
| 48 static bool isCJKIdeograph(UChar32); | 48 static bool isCJKIdeograph(UChar32); |
| 49 static bool isCJKIdeographOrSymbol(UChar32); | 49 static bool isCJKIdeographOrSymbol(UChar32); |
| 50 | 50 |
| 51 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD irection, bool& isAfterExpansion); | 51 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD irection, bool& isAfterExpansion, const bool distributeJustification); |
| 52 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD irection, bool& isAfterExpansion); | 52 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD irection, bool& isAfterExpansion, const bool distributeJustification); |
|
leviw_travelin_and_unemployed
2014/07/28 23:59:58
Can we use an enum instead of an extra bool? :-/
dw.im
2014/07/29 01:54:54
I guess so. And, using enum also can give chance t
| |
| 53 | 53 |
| 54 static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n ' || c == noBreakSpace; } | 54 static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n ' || c == noBreakSpace; } |
| 55 static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInC omplexScript(c) || c == 0x200c || c == 0x200d; } | 55 static bool treatAsZeroWidthSpace(UChar c) { return treatAsZeroWidthSpaceInC omplexScript(c) || c == 0x200c || c == 0x200d; } |
| 56 static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x 200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpa ce || c == objectReplacementCharacter; } | 56 static bool treatAsZeroWidthSpaceInComplexScript(UChar c) { return c < 0x20 || (c >= 0x7F && c < 0xA0) || c == softHyphen || c == zeroWidthSpace || (c >= 0x 200e && c <= 0x200f) || (c >= 0x202a && c <= 0x202e) || c == zeroWidthNoBreakSpa ce || c == objectReplacementCharacter; } |
| 57 static bool canReceiveTextEmphasis(UChar32); | 57 static bool canReceiveTextEmphasis(UChar32); |
| 58 | 58 |
| 59 static inline UChar normalizeSpaces(UChar character) | 59 static inline UChar normalizeSpaces(UChar character) |
| 60 { | 60 { |
| 61 if (treatAsSpace(character)) | 61 if (treatAsSpace(character)) |
| 62 return space; | 62 return space; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 Character(); | 79 Character(); |
| 80 | 80 |
| 81 static const uint8_t s_roundingHackCharacterTable[256]; | 81 static const uint8_t s_roundingHackCharacterTable[256]; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 } | 84 } |
| 85 | 85 |
| 86 #endif | 86 #endif |
| OLD | NEW |