OLD | NEW |
---|---|
1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
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 field in fields if field.storage_type_path != None %} | 9 {% for field in fields if field.storage_type_path != None %} |
10 #include "{{field.storage_type_path}}.h" | 10 #include "{{field.storage_type_path}}.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
96 // Copies the values of any independent inherited properties from the parent | 96 // Copies the values of any independent inherited properties from the parent |
97 // style that are marked as inherited by this style. | 97 // style that are marked as inherited by this style. |
98 void propagateIndependentInheritedProperties( | 98 void propagateIndependentInheritedProperties( |
99 const ComputedStyleBase& parentStyle); | 99 const ComputedStyleBase& parentStyle); |
100 | 100 |
101 // Fields. | 101 // Fields. |
102 // TODO(sashab): Remove initialFoo() static methods and update callers to | 102 // TODO(sashab): Remove initialFoo() static methods and update callers to |
103 // use resetFoo(), which can be more efficient. | 103 // use resetFoo(), which can be more efficient. |
104 {% for field in fields %} | 104 {% for field in fields %} |
105 // {{field.property_name}} | 105 // {{field.property_name}} |
106 {% if field.is_property or field.is_inherited_flag %} | |
sashab
2017/02/03 04:53:06
Do you need this? Why not have a way to get the de
shend
2017/02/03 05:11:32
I was trying to keep the generated code the same a
| |
106 inline static {{field.storage_type}} {{field.initial_method_name}}() { return {{field.default_value}}; } | 107 inline static {{field.storage_type}} {{field.initial_method_name}}() { return {{field.default_value}}; } |
108 {% endif %} | |
107 {{field.storage_type}} {{field.getter_method_name}}() const { return static_ca st<{{field.storage_type}}>({{field.name}}); } | 109 {{field.storage_type}} {{field.getter_method_name}}() const { return static_ca st<{{field.storage_type}}>({{field.name}}); } |
110 {% if field.is_nonproperty %} | |
111 void {{field.setter_method_name}}() { {{field.name}} = true; } | |
sashab
2017/02/03 04:53:06
Ahh, this is kind of annoying! Would be great to k
shend
2017/02/03 05:11:32
Yeah, so all nonproperty fields I've seen use the
| |
112 {% else %} | |
108 void {{field.setter_method_name}}({{field.storage_type}} v) { {{field.name}} = static_cast<unsigned>(v); } | 113 void {{field.setter_method_name}}({{field.storage_type}} v) { {{field.name}} = static_cast<unsigned>(v); } |
114 {% endif %} | |
109 inline void {{field.resetter_method_name}}() { {{field.name}} = {{default_valu e(field)}}; } | 115 inline void {{field.resetter_method_name}}() { {{field.name}} = {{default_valu e(field)}}; } |
110 | 116 |
111 {% endfor %} | 117 {% endfor %} |
112 protected: | 118 protected: |
113 // Storage. | 119 // Storage. |
114 {% for field in fields %} | 120 {% for field in fields %} |
115 unsigned {{field.name}} : {{field.size}}; // {{field.storage_type}} | 121 unsigned {{field.name}} : {{field.size}}; // {{field.storage_type}} |
116 {% endfor %} | 122 {% endfor %} |
117 }; | 123 }; |
118 | 124 |
119 } // namespace blink | 125 } // namespace blink |
120 | 126 |
121 #endif // ComputedStyleBase_h | 127 #endif // ComputedStyleBase_h |
OLD | NEW |