Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: third_party/WebKit/Source/platform/text/Character.h

Issue 1964773002: Render Unicode control characters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 || c == tabulationCharacter 89 || c == tabulationCharacter
90 || c == newlineCharacter 90 || c == newlineCharacter
91 || c == noBreakSpaceCharacter; 91 || c == noBreakSpaceCharacter;
92 } 92 }
93 static bool treatAsZeroWidthSpace(UChar32 c) 93 static bool treatAsZeroWidthSpace(UChar32 c)
94 { 94 {
95 return treatAsZeroWidthSpaceInComplexScript(c) 95 return treatAsZeroWidthSpaceInComplexScript(c)
96 || c == zeroWidthNonJoinerCharacter 96 || c == zeroWidthNonJoinerCharacter
97 || c == zeroWidthJoinerCharacter; 97 || c == zeroWidthJoinerCharacter;
98 } 98 }
99 static bool treatAsZeroWidthSpaceInComplexScript(UChar32 c) 99 static bool legacyTreatAsZeroWidthSpaceInComplexScript(UChar32 c)
100 { 100 {
101 return c < 0x20 // ASCII Control Characters 101 return c < 0x20 // ASCII Control Characters
102 || (c >= 0x7F && c < 0xA0) // ASCII Delete .. No-break spaceCharacte r 102 || (c >= 0x7F && c < 0xA0) // ASCII Delete .. No-break spaceCharacte r
103 || treatAsZeroWidthSpaceInComplexScript(c);
104 }
105 static bool treatAsZeroWidthSpaceInComplexScript(UChar32 c)
106 {
107 return c == formFeedCharacter
108 || c == carriageReturnCharacter
kojii 2016/05/19 03:44:59 || c == noBreakSpaceCharacter ? 0xA0 should not be
103 || c == softHyphenCharacter 109 || c == softHyphenCharacter
104 || c == zeroWidthSpaceCharacter 110 || c == zeroWidthSpaceCharacter
105 || (c >= leftToRightMarkCharacter && c <= rightToLeftMarkCharacter) 111 || (c >= leftToRightMarkCharacter && c <= rightToLeftMarkCharacter)
106 || (c >= leftToRightEmbedCharacter && c <= rightToLeftOverrideCharac ter) 112 || (c >= leftToRightEmbedCharacter && c <= rightToLeftOverrideCharac ter)
107 || c == zeroWidthNoBreakSpaceCharacter 113 || c == zeroWidthNoBreakSpaceCharacter
108 || c == objectReplacementCharacter; 114 || c == objectReplacementCharacter;
109 } 115 }
110 static bool canReceiveTextEmphasis(UChar32); 116 static bool canReceiveTextEmphasis(UChar32);
111 117
112 static bool isGraphemeExtended(UChar32 c) 118 static bool isGraphemeExtended(UChar32 c)
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 161
156 static String normalizeSpaces(const LChar*, unsigned length); 162 static String normalizeSpaces(const LChar*, unsigned length);
157 static String normalizeSpaces(const UChar*, unsigned length); 163 static String normalizeSpaces(const UChar*, unsigned length);
158 164
159 static bool isCommonOrInheritedScript(UChar32); 165 static bool isCommonOrInheritedScript(UChar32);
160 }; 166 };
161 167
162 } // namespace blink 168 } // namespace blink
163 169
164 #endif 170 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698