OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // Check for lone surrogate which characterStartingAt does not retur
n. | 212 // Check for lone surrogate which characterStartingAt does not retur
n. |
213 c = identifier[index]; | 213 c = identifier[index]; |
214 if (c == 0) | 214 if (c == 0) |
215 return false; | 215 return false; |
216 } | 216 } |
217 | 217 |
218 index += U16_LENGTH(c); | 218 index += U16_LENGTH(c); |
219 | 219 |
220 if (c <= 0x1f || c == 0x7f || (0x30 <= c && c <= 0x39 && (isFirst || (is
Second && isFirstCharHyphen)))) | 220 if (c <= 0x1f || c == 0x7f || (0x30 <= c && c <= 0x39 && (isFirst || (is
Second && isFirstCharHyphen)))) |
221 serializeCharacterAsCodePoint(c, appendTo); | 221 serializeCharacterAsCodePoint(c, appendTo); |
| 222 else if (c == 0x2d && isFirst && index == identifier.length()) |
| 223 serializeCharacter(c, appendTo); |
222 else if (0x80 <= c || c == 0x2d || c == 0x5f || (0x30 <= c && c <= 0x39)
|| (0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a)) | 224 else if (0x80 <= c || c == 0x2d || c == 0x5f || (0x30 <= c && c <= 0x39)
|| (0x41 <= c && c <= 0x5a) || (0x61 <= c && c <= 0x7a)) |
223 appendTo.append(c); | 225 appendTo.append(c); |
224 else | 226 else |
225 serializeCharacter(c, appendTo); | 227 serializeCharacter(c, appendTo); |
226 | 228 |
227 if (isFirst) { | 229 if (isFirst) { |
228 isFirst = false; | 230 isFirst = false; |
229 isSecond = true; | 231 isSecond = true; |
230 isFirstCharHyphen = (c == 0x2d); | 232 isFirstCharHyphen = (c == 0x2d); |
231 } else if (isSecond) { | 233 } else if (isSecond) { |
(...skipping 23 matching lines...) Expand all Loading... |
255 } | 257 } |
256 | 258 |
257 String serializeString(const String& string) | 259 String serializeString(const String& string) |
258 { | 260 { |
259 StringBuilder builder; | 261 StringBuilder builder; |
260 serializeString(string, builder); | 262 serializeString(string, builder); |
261 return builder.toString(); | 263 return builder.toString(); |
262 } | 264 } |
263 | 265 |
264 } // namespace blink | 266 } // namespace blink |
OLD | NEW |