Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 {% from 'macros.tmpl' import license, print_if %} | 1 {% from 'macros.tmpl' import license, print_if %} |
| 2 {% from 'fields/field.tmpl' import encode, getter_expression, setter_expression, declare_storage, fieldwise_compare, fieldwise_copy, fieldwise_diff %} | 2 {% from 'fields/field.tmpl' import encode, getter_expression, setter_expression, declare_storage, fieldwise_compare, fieldwise_copy, fieldwise_diff %} |
| 3 {% from 'fields/group.tmpl' import define_field_group_class %} | 3 {% from 'fields/group.tmpl' import define_field_group_class %} |
| 4 {{license()}} | 4 {{license()}} |
| 5 | 5 |
| 6 #ifndef ComputedStyleBase_h | 6 #ifndef ComputedStyleBase_h |
| 7 #define ComputedStyleBase_h | 7 #define ComputedStyleBase_h |
| 8 | 8 |
| 9 #include "core/style/ComputedStyleConstants.h" | 9 #include "core/style/ComputedStyleConstants.h" |
| 10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 void PropagateIndependentInheritedProperties( | 107 void PropagateIndependentInheritedProperties( |
| 108 const ComputedStyleBase& parentStyle) { | 108 const ComputedStyleBase& parentStyle) { |
| 109 {% for field in computed_style.all_fields if field.is_property and field.is_ independent %} | 109 {% for field in computed_style.all_fields if field.is_property and field.is_ independent %} |
| 110 if ({{field.is_inherited_method_name}}()) | 110 if ({{field.is_inherited_method_name}}()) |
| 111 {{setter_expression(field)}} = parentStyle.{{getter_expression(field)}}; | 111 {{setter_expression(field)}} = parentStyle.{{getter_expression(field)}}; |
| 112 {% endfor %} | 112 {% endfor %} |
| 113 } | 113 } |
| 114 | 114 |
| 115 {% for name, groups_to_diff in diff_functions_map.items() %} | 115 {% for name, groups_to_diff in diff_functions_map.items() %} |
| 116 bool {{name}}(const T& other) const { | 116 bool {{name}}(const T& other) const { |
| 117 const T& self = static_cast<const T&>(*this); | |
|
nainar
2017/05/12 06:48:27
Can't decide if this should be in this tmpl file o
shend
2017/05/12 06:59:17
Should be here. If we want to use multiple fieldwi
nainar
2017/05/12 07:07:47
yup, passing self into fieldwise_diff
| |
| 117 {{fieldwise_diff(groups_to_diff)|indent(2)}} | 118 {{fieldwise_diff(groups_to_diff)|indent(2)}} |
| 118 return false; | 119 return false; |
| 119 } | 120 } |
| 120 {% endfor %} | 121 {% endfor %} |
| 121 | 122 |
| 122 // Fields. | 123 // Fields. |
| 123 // TODO(sashab): Remove initialFoo() static methods and update callers to | 124 // TODO(sashab): Remove initialFoo() static methods and update callers to |
| 124 // use resetFoo(), which can be more efficient. | 125 // use resetFoo(), which can be more efficient. |
| 125 | 126 |
| 126 {% for field in computed_style.all_fields %} | 127 {% for field in computed_style.all_fields %} |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 | 171 |
| 171 private: | 172 private: |
| 172 {% for field in computed_style.fields %} | 173 {% for field in computed_style.fields %} |
| 173 {{declare_storage(field)}} | 174 {{declare_storage(field)}} |
| 174 {% endfor %} | 175 {% endfor %} |
| 175 }; | 176 }; |
| 176 | 177 |
| 177 } // namespace blink | 178 } // namespace blink |
| 178 | 179 |
| 179 #endif // ComputedStyleBase_h | 180 #endif // ComputedStyleBase_h |
| OLD | NEW |