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

Side by Side Diff: third_party/WebKit/Source/wtf/text/TextCodec.h

Issue 1709293002: Add support for CSS unicod encoding to the text codec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a css test. 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) 2004, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com> 3 * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Substitutes the replacement character "?". 43 // Substitutes the replacement character "?".
44 QuestionMarksForUnencodables, 44 QuestionMarksForUnencodables,
45 45
46 // Encodes the character as an XML entity. For example, U+06DE 46 // Encodes the character as an XML entity. For example, U+06DE
47 // would be "&#1758;" (0x6DE = 1758 in octal). 47 // would be "&#1758;" (0x6DE = 1758 in octal).
48 EntitiesForUnencodables, 48 EntitiesForUnencodables,
49 49
50 // Encodes the character as en entity as above, but escaped 50 // Encodes the character as en entity as above, but escaped
51 // non-alphanumeric characters. This is used in URLs. 51 // non-alphanumeric characters. This is used in URLs.
52 // For example, U+6DE would be "%26%231758%3B". 52 // For example, U+6DE would be "%26%231758%3B".
53 URLEncodedEntitiesForUnencodables 53 URLEncodedEntitiesForUnencodables,
54
55 // Encodes the character as a CSS entity. For example U+06DE
56 // would be \06de. See: https://www.w3.org/TR/css-syntax-3/#escaping
57 CSSEncodedEntitiesForUnencodables
Łukasz Anforowicz 2016/04/27 04:28:12 nit: I read that C++11 allows a trailing comma in
bburns 2016/04/27 20:24:21 Done.
54 }; 58 };
55 59
56 typedef char UnencodableReplacementArray[32]; 60 typedef char UnencodableReplacementArray[32];
57 61
58 enum FlushBehavior { 62 enum FlushBehavior {
59 // More bytes are coming, don't flush the codec. 63 // More bytes are coming, don't flush the codec.
60 DoNotFlush = 0, 64 DoNotFlush = 0,
61 65
62 // A fetch has hit EOF. Some codecs handle fetches differently, for compat r easons. 66 // A fetch has hit EOF. Some codecs handle fetches differently, for compat r easons.
63 FetchEOF, 67 FetchEOF,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name); 100 typedef void (*EncodingNameRegistrar)(const char* alias, const char* name);
97 101
98 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData); 102 typedef PassOwnPtr<TextCodec> (*NewTextCodecFunction)(const TextEncoding&, const void* additionalData);
99 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData); 103 typedef void (*TextCodecRegistrar)(const char* name, NewTextCodecFunction, const void* additionalData);
100 104
101 } // namespace WTF 105 } // namespace WTF
102 106
103 using WTF::TextCodec; 107 using WTF::TextCodec;
104 108
105 #endif // TextCodec_h 109 #endif // TextCodec_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698