OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 import subprocess | 3 import subprocess |
4 import sys | 4 import sys |
5 | 5 |
6 import css_properties | 6 import css_properties |
7 import in_generator | 7 import in_generator |
8 import license | 8 import license |
9 | 9 |
10 | 10 |
11 HEADER_TEMPLATE = """ | 11 HEADER_TEMPLATE = """ |
12 %(license)s | 12 %(license)s |
13 | 13 |
14 #ifndef %(class_name)s_h | 14 #ifndef %(class_name)s_h |
15 #define %(class_name)s_h | 15 #define %(class_name)s_h |
16 | 16 |
| 17 #include "core/CoreExport.h" |
17 #include "core/css/parser/CSSParserMode.h" | 18 #include "core/css/parser/CSSParserMode.h" |
18 #include "wtf/HashFunctions.h" | 19 #include "wtf/HashFunctions.h" |
19 #include "wtf/HashTraits.h" | 20 #include "wtf/HashTraits.h" |
20 #include <string.h> | 21 #include <string.h> |
21 | 22 |
22 namespace WTF { | 23 namespace WTF { |
23 class AtomicString; | 24 class AtomicString; |
24 class String; | 25 class String; |
25 } | 26 } |
26 | 27 |
(...skipping 26 matching lines...) Expand all Loading... |
53 | 54 |
54 inline CSSPropertyID resolveCSSPropertyID(CSSPropertyID id) | 55 inline CSSPropertyID resolveCSSPropertyID(CSSPropertyID id) |
55 { | 56 { |
56 return convertToCSSPropertyID(id & ~512); | 57 return convertToCSSPropertyID(id & ~512); |
57 } | 58 } |
58 | 59 |
59 inline bool isPropertyAlias(CSSPropertyID id) { return id & 512; } | 60 inline bool isPropertyAlias(CSSPropertyID id) { return id & 512; } |
60 | 61 |
61 CSSPropertyID unresolvedCSSPropertyID(const WTF::String&); | 62 CSSPropertyID unresolvedCSSPropertyID(const WTF::String&); |
62 | 63 |
63 CSSPropertyID cssPropertyID(const WTF::String&); | 64 CSSPropertyID CORE_EXPORT cssPropertyID(const WTF::String&); |
64 | 65 |
65 } // namespace blink | 66 } // namespace blink |
66 | 67 |
67 namespace WTF { | 68 namespace WTF { |
68 template<> struct DefaultHash<blink::CSSPropertyID> { typedef IntHash<unsigned>
Hash; }; | 69 template<> struct DefaultHash<blink::CSSPropertyID> { typedef IntHash<unsigned>
Hash; }; |
69 template<> struct HashTraits<blink::CSSPropertyID> : GenericHashTraits<blink::CS
SPropertyID> { | 70 template<> struct HashTraits<blink::CSSPropertyID> : GenericHashTraits<blink::CS
SPropertyID> { |
70 static const bool emptyValueIsZero = true; | 71 static const bool emptyValueIsZero = true; |
71 static void constructDeletedValue(blink::CSSPropertyID& slot, bool) { slot =
static_cast<blink::CSSPropertyID>(blink::lastUnresolvedCSSProperty + 1); } | 72 static void constructDeletedValue(blink::CSSPropertyID& slot, bool) { slot =
static_cast<blink::CSSPropertyID>(blink::lastUnresolvedCSSProperty + 1); } |
72 static bool isDeletedValue(blink::CSSPropertyID value) { return value == (bl
ink::lastUnresolvedCSSProperty + 1); } | 73 static bool isDeletedValue(blink::CSSPropertyID value) { return value == (bl
ink::lastUnresolvedCSSProperty + 1); } |
73 }; | 74 }; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output | 230 # FIXME: If we could depend on Python 2.7, we would use subprocess.check
_output |
230 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] | 231 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] |
231 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. | 232 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. |
232 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. | 233 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. |
233 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) | 234 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr
ocess.PIPE, universal_newlines=True) |
234 return gperf.communicate(gperf_input)[0] | 235 return gperf.communicate(gperf_input)[0] |
235 | 236 |
236 | 237 |
237 if __name__ == "__main__": | 238 if __name__ == "__main__": |
238 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) | 239 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) |
OLD | NEW |