| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 static unsigned expansionOpportunityCount(const TextRun& run, bool& isAfterE
xpansion) | 74 static unsigned expansionOpportunityCount(const TextRun& run, bool& isAfterE
xpansion) |
| 75 { | 75 { |
| 76 if (run.is8Bit()) | 76 if (run.is8Bit()) |
| 77 return expansionOpportunityCount(run.characters8(), run.length(), ru
n.direction(), isAfterExpansion, run.getTextJustify()); | 77 return expansionOpportunityCount(run.characters8(), run.length(), ru
n.direction(), isAfterExpansion, run.getTextJustify()); |
| 78 return expansionOpportunityCount(run.characters16(), run.length(), run.d
irection(), isAfterExpansion, run.getTextJustify()); | 78 return expansionOpportunityCount(run.characters16(), run.length(), run.d
irection(), isAfterExpansion, run.getTextJustify()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 static bool isUprightInMixedVertical(UChar32 character); | 81 static bool isUprightInMixedVertical(UChar32 character); |
| 82 | 82 |
| 83 // https://html.spec.whatwg.org/multipage/scripting.html#prod-potentialcusto
melementname | 83 // https://html.spec.whatwg.org/multipage/scripting.html#prod-potentialcusto
melementname |
| 84 static bool isPotentialCustomElementNameStartChar(UChar ch) |
| 85 { |
| 86 return 'a' <= ch && ch <= 'z'; |
| 87 } |
| 88 static bool isPotentialCustomElementName8BitChar(UChar ch) |
| 89 { |
| 90 DCHECK_LE(ch, 0xff); |
| 91 return ('a' <= ch && ch <= 'z') |
| 92 || ('0' <= ch && ch <= '9') |
| 93 || ch == '-' || ch == '.' || ch == '_' || ch == 0xb7 |
| 94 || (0xc0 <= ch && ch != 0xd7 && ch != 0xf7); |
| 95 } |
| 84 static bool isPotentialCustomElementNameChar(UChar32 character); | 96 static bool isPotentialCustomElementNameChar(UChar32 character); |
| 85 | 97 |
| 86 static bool treatAsSpace(UChar32 c) | 98 static bool treatAsSpace(UChar32 c) |
| 87 { | 99 { |
| 88 return c == spaceCharacter | 100 return c == spaceCharacter |
| 89 || c == tabulationCharacter | 101 || c == tabulationCharacter |
| 90 || c == newlineCharacter | 102 || c == newlineCharacter |
| 91 || c == noBreakSpaceCharacter; | 103 || c == noBreakSpaceCharacter; |
| 92 } | 104 } |
| 93 static bool treatAsZeroWidthSpace(UChar32 c) | 105 static bool treatAsZeroWidthSpace(UChar32 c) |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 173 |
| 162 static String normalizeSpaces(const LChar*, unsigned length); | 174 static String normalizeSpaces(const LChar*, unsigned length); |
| 163 static String normalizeSpaces(const UChar*, unsigned length); | 175 static String normalizeSpaces(const UChar*, unsigned length); |
| 164 | 176 |
| 165 static bool isCommonOrInheritedScript(UChar32); | 177 static bool isCommonOrInheritedScript(UChar32); |
| 166 }; | 178 }; |
| 167 | 179 |
| 168 } // namespace blink | 180 } // namespace blink |
| 169 | 181 |
| 170 #endif | 182 #endif |
| OLD | NEW |