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 {# Returns the default value for the field, converted to fit in the storage cont ainer. #} | 13 {# Returns the default value for the field, converted to fit in the storage cont ainer. #} |
14 {% macro default_value(field) -%} | 14 {% macro default_value(field) -%} |
15 {# We only support enum fields for now. #} | 15 {# We only support enum fields for now. #} |
16 static_cast<unsigned>({{field.default_value}}) | 16 static_cast<unsigned>({{field.default_value}}) |
17 {%- endmacro %} | 17 {%- endmacro %} |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 // The generated portion of ComputedStyle. For more info, see the header comment | 21 // The generated portion of ComputedStyle. For more info, see the header comment |
22 // in ComputedStyle.h. | 22 // in ComputedStyle.h. |
23 class CORE_EXPORT ComputedStyleBase { | 23 class CORE_EXPORT ComputedStyleBase { |
24 public: | 24 public: |
25 ALWAYS_INLINE ComputedStyleBase() : | 25 ALWAYS_INLINE ComputedStyleBase() : |
26 {% for field in fields %} | 26 {% for field in fields %} |
27 {{field.name}}({{default_value(field)}}){{print_if(not loop.last, ',')}} | 27 {{field.name}}({{default_value(field)}}){{print_if(not loop.last, ',')}} |
28 {% endfor %} | 28 {% endfor %} |
29 {} | 29 {} |
30 ~ComputedStyleBase() {} | |
meade_UTC10
2017/03/10 04:04:46
I'm a bit surprised this isn't virtual. Since this
sashab
2017/03/10 04:51:02
Making it a virtual subclass will add vtables to C
| |
31 | 30 |
32 ALWAYS_INLINE ComputedStyleBase(const ComputedStyleBase& o) : | 31 ALWAYS_INLINE ComputedStyleBase(const ComputedStyleBase& o) : |
33 {% for field in fields %} | 32 {% for field in fields %} |
34 {{field.name}}(o.{{field.name}}){{print_if(not loop.last, ',')}} | 33 {{field.name}}(o.{{field.name}}){{print_if(not loop.last, ',')}} |
35 {% endfor %} | 34 {% endfor %} |
36 {} | 35 {} |
37 | 36 |
38 bool operator==(const ComputedStyleBase& o) const { | 37 bool operator==(const ComputedStyleBase& o) const { |
39 return ( | 38 return ( |
40 {% for field in fields %} | 39 {% for field in fields %} |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 protected: | 119 protected: |
121 // Storage. | 120 // Storage. |
122 {% for field in fields %} | 121 {% for field in fields %} |
123 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} | 122 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} |
124 {% endfor %} | 123 {% endfor %} |
125 }; | 124 }; |
126 | 125 |
127 } // namespace blink | 126 } // namespace blink |
128 | 127 |
129 #endif // ComputedStyleBase_h | 128 #endif // ComputedStyleBase_h |
OLD | NEW |