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

Side by Side Diff: third_party/WebKit/Source/build/scripts/make_css_property_names.py

Issue 1406993009: Revert "CSS Custom Properties (Variables)" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 #!/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
(...skipping 10 matching lines...) Expand all
21 21
22 namespace WTF { 22 namespace WTF {
23 class AtomicString; 23 class AtomicString;
24 class String; 24 class String;
25 } 25 }
26 26
27 namespace blink { 27 namespace blink {
28 28
29 enum CSSPropertyID { 29 enum CSSPropertyID {
30 CSSPropertyInvalid = 0, 30 CSSPropertyInvalid = 0,
31 CSSPropertyVariable = 1,
32 %(property_enums)s 31 %(property_enums)s
33 }; 32 };
34 33
35 const int firstCSSProperty = %(first_property_id)s; 34 const int firstCSSProperty = %(first_property_id)s;
36 const int numCSSProperties = %(properties_count)s; 35 const int numCSSProperties = %(properties_count)s;
37 const int lastCSSProperty = %(last_property_id)d; 36 const int lastCSSProperty = %(last_property_id)d;
38 const int lastUnresolvedCSSProperty = %(last_unresolved_property_id)d; 37 const int lastUnresolvedCSSProperty = %(last_unresolved_property_id)d;
39 const size_t maxCSSPropertyNameLength = %(max_name_length)d; 38 const size_t maxCSSPropertyNameLength = %(max_name_length)d;
40 39
41 const char* getPropertyName(CSSPropertyID); 40 const char* getPropertyName(CSSPropertyID);
42 const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID); 41 const WTF::AtomicString& getPropertyNameAtomicString(CSSPropertyID);
43 WTF::String getPropertyNameString(CSSPropertyID); 42 WTF::String getPropertyNameString(CSSPropertyID);
44 WTF::String getJSPropertyName(CSSPropertyID); 43 WTF::String getJSPropertyName(CSSPropertyID);
45 44
46 inline CSSPropertyID convertToCSSPropertyID(int value) 45 inline CSSPropertyID convertToCSSPropertyID(int value)
47 { 46 {
48 ASSERT((value >= firstCSSProperty && value <= lastCSSProperty) || value == C SSPropertyInvalid || value == CSSPropertyVariable); 47 ASSERT((value >= firstCSSProperty && value <= lastCSSProperty) || value == C SSPropertyInvalid);
49 return static_cast<CSSPropertyID>(value); 48 return static_cast<CSSPropertyID>(value);
50 } 49 }
51 50
52 inline CSSPropertyID resolveCSSPropertyID(CSSPropertyID id) 51 inline CSSPropertyID resolveCSSPropertyID(CSSPropertyID id)
53 { 52 {
54 return convertToCSSPropertyID(id & ~512); 53 return convertToCSSPropertyID(id & ~512);
55 } 54 }
56 55
57 inline bool isPropertyAlias(CSSPropertyID id) { return id & 512; } 56 inline bool isPropertyAlias(CSSPropertyID id) { return id & 512; }
58 57
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 # FIXME: If we could depend on Python 2.7, we would use subprocess.check _output 222 # FIXME: If we could depend on Python 2.7, we would use subprocess.check _output
224 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n'] 223 gperf_args = [self.gperf_path, '--key-positions=*', '-P', '-n']
225 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts. 224 gperf_args.extend(['-m', '50']) # Pick best of 50 attempts.
226 gperf_args.append('-D') # Allow duplicate hashes -> More compact code. 225 gperf_args.append('-D') # Allow duplicate hashes -> More compact code.
227 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr ocess.PIPE, universal_newlines=True) 226 gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subpr ocess.PIPE, universal_newlines=True)
228 return gperf.communicate(gperf_input)[0] 227 return gperf.communicate(gperf_input)[0]
229 228
230 229
231 if __name__ == "__main__": 230 if __name__ == "__main__":
232 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv) 231 in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698