OLD | NEW |
1 {% from 'macros.tmpl' import license, print_if %} | 1 {% from 'macros.tmpl' import license, print_if %} |
2 {{license()}} | 2 {{license()}} |
3 | 3 |
4 #ifndef ComputedStyleBase_h | 4 #ifndef ComputedStyleBase_h |
5 #define ComputedStyleBase_h | 5 #define ComputedStyleBase_h |
6 | 6 |
7 #include "core/ComputedStyleBaseConstants.h" | 7 #include "core/ComputedStyleBaseConstants.h" |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 {% for path in include_paths %} | 9 {% for path in include_paths %} |
10 #include "{{path}}" | 10 #include "{{path}}" |
11 {% endfor %} | 11 {% endfor %} |
12 | 12 |
13 {# Each field template has macros that we can call to generate specific | 13 {# Each field template has macros that we can call to generate specific |
14 aspects of the field (e.g. getters, setters). | 14 aspects of the field (e.g. getters, setters). |
15 #} | 15 #} |
16 {% import 'fields/keyword.tmpl' as keyword %} | 16 {% import 'fields/keyword.tmpl' as keyword %} |
17 {% import 'fields/flag.tmpl' as flag %} | 17 {% import 'fields/flag.tmpl' as flag %} |
18 {% import 'fields/monotonic_flag.tmpl' as monotonic_flag %} | 18 {% import 'fields/monotonic_flag.tmpl' as monotonic_flag %} |
19 {% set field_templates = { 'keyword': keyword, 'flag': flag, 'monotonic_flag': m
onotonic_flag } %} | 19 {% import 'fields/external.tmpl' as external %} |
| 20 {% set field_templates = { |
| 21 'keyword': keyword, |
| 22 'flag': flag, |
| 23 'monotonic_flag': monotonic_flag, |
| 24 'external': external |
| 25 } %} |
20 | 26 |
21 namespace blink { | 27 namespace blink { |
22 | 28 |
23 // The generated portion of ComputedStyle. For more info, see the header comment | 29 // The generated portion of ComputedStyle. For more info, see the header comment |
24 // in ComputedStyle.h. | 30 // in ComputedStyle.h. |
25 class CORE_EXPORT ComputedStyleBase { | 31 class CORE_EXPORT ComputedStyleBase { |
26 public: | 32 public: |
27 ALWAYS_INLINE ComputedStyleBase() : | 33 ALWAYS_INLINE ComputedStyleBase() : |
28 {% for field in fields %} | 34 {% for field in fields %} |
| 35 {% if field.is_packed %} |
29 {{field.name}}(static_cast<unsigned>({{field.default_value}})){{print_if(n
ot loop.last, ',')}} | 36 {{field.name}}(static_cast<unsigned>({{field.default_value}})){{print_if(n
ot loop.last, ',')}} |
| 37 {% else %} |
| 38 {{field.name}}({{field.default_value}}){{print_if(not loop.last, ',')}} |
| 39 {% endif %} |
30 {% endfor %} | 40 {% endfor %} |
31 {} | 41 {} |
32 ~ComputedStyleBase() {} | 42 ~ComputedStyleBase() {} |
33 | 43 |
34 ALWAYS_INLINE ComputedStyleBase(const ComputedStyleBase& o) : | 44 ALWAYS_INLINE ComputedStyleBase(const ComputedStyleBase& o) : |
35 {% for field in fields %} | 45 {% for field in fields %} |
36 {{field.name}}(o.{{field.name}}){{print_if(not loop.last, ',')}} | 46 {{field.name}}(o.{{field.name}}){{print_if(not loop.last, ',')}} |
37 {% endfor %} | 47 {% endfor %} |
38 {} | 48 {} |
39 | 49 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // use resetFoo(), which can be more efficient. | 108 // use resetFoo(), which can be more efficient. |
99 | 109 |
100 {% for field in fields %} | 110 {% for field in fields %} |
101 // {{field.property_name}} | 111 // {{field.property_name}} |
102 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} | 112 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} |
103 | 113 |
104 {% endfor %} | 114 {% endfor %} |
105 protected: | 115 protected: |
106 // Storage. | 116 // Storage. |
107 {% for field in fields %} | 117 {% for field in fields %} |
| 118 {% if field.is_packed %} |
108 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} | 119 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} |
| 120 {% else %} |
| 121 {{field.type_name}} {{field.name}}; |
| 122 {% endif %} |
109 {% endfor %} | 123 {% endfor %} |
110 }; | 124 }; |
111 | 125 |
112 } // namespace blink | 126 } // namespace blink |
113 | 127 |
114 #endif // ComputedStyleBase_h | 128 #endif // ComputedStyleBase_h |
OLD | NEW |