| 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 json5_generator | 7 import json5_generator |
| 8 import license | 8 import license |
| 9 | 9 |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // This isn't a property, but we need to know the position of @apply rules i
n style rules | 30 // This isn't a property, but we need to know the position of @apply rules i
n style rules |
| 31 CSSPropertyApplyAtRule = 1, | 31 CSSPropertyApplyAtRule = 1, |
| 32 CSSPropertyVariable = 2, | 32 CSSPropertyVariable = 2, |
| 33 %(property_enums)s | 33 %(property_enums)s |
| 34 }; | 34 }; |
| 35 | 35 |
| 36 const int firstCSSProperty = %(first_property_id)s; | 36 const int firstCSSProperty = %(first_property_id)s; |
| 37 const int numCSSProperties = %(properties_count)s; | 37 const int numCSSProperties = %(properties_count)s; |
| 38 const int lastCSSProperty = %(last_property_id)d; | 38 const int lastCSSProperty = %(last_property_id)d; |
| 39 const int lastUnresolvedCSSProperty = %(last_unresolved_property_id)d; | 39 const int lastUnresolvedCSSProperty = %(last_unresolved_property_id)d; |
| 40 const int numCSSPropertyIDs = lastUnresolvedCSSProperty + 1; |
| 40 const size_t maxCSSPropertyNameLength = %(max_name_length)d; | 41 const size_t maxCSSPropertyNameLength = %(max_name_length)d; |
| 41 | 42 |
| 42 const char* getPropertyName(CSSPropertyID); | 43 const char* getPropertyName(CSSPropertyID); |
| 43 const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID); | 44 const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID); |
| 44 WTF::String getPropertyNameString(CSSPropertyID); | 45 WTF::String getPropertyNameString(CSSPropertyID); |
| 45 WTF::String getJSPropertyName(CSSPropertyID); | 46 WTF::String getJSPropertyName(CSSPropertyID); |
| 46 | 47 |
| 47 inline bool isCSSPropertyIDWithName(int id) | 48 inline bool isCSSPropertyIDWithName(int id) |
| 48 { | 49 { |
| 49 return id >= firstCSSProperty && id <= lastUnresolvedCSSProperty; | 50 return id >= firstCSSProperty && id <= lastUnresolvedCSSProperty; |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 # CalledProcessError like subprocess would do when shell=True is set. | 238 # CalledProcessError like subprocess would do when shell=True is set. |
| 238 try: | 239 try: |
| 239 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=s
ubprocess.PIPE, universal_newlines=True) | 240 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=s
ubprocess.PIPE, universal_newlines=True) |
| 240 return gperf.communicate(gperf_input)[0] | 241 return gperf.communicate(gperf_input)[0] |
| 241 except OSError: | 242 except OSError: |
| 242 raise subprocess.CalledProcessError(127, gperf_args, output='Command
not found.') | 243 raise subprocess.CalledProcessError(127, gperf_args, output='Command
not found.') |
| 243 | 244 |
| 244 | 245 |
| 245 if __name__ == "__main__": | 246 if __name__ == "__main__": |
| 246 json5_generator.Maker(CSSPropertyNamesWriter).main() | 247 json5_generator.Maker(CSSPropertyNamesWriter).main() |
| OLD | NEW |