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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl

Issue 2876803003: Generate diffs for fields in ComputedStyle that use their public getters (Closed)
Patch Set: alancutter@'s suggestions Created 3 years, 7 months 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 {% 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void PropagateIndependentInheritedProperties( 123 void PropagateIndependentInheritedProperties(
124 const ComputedStyleBase& parentStyle) { 124 const ComputedStyleBase& parentStyle) {
125 {% for field in computed_style.all_fields if field.is_property and field.is_ independent %} 125 {% for field in computed_style.all_fields if field.is_property and field.is_ independent %}
126 if ({{field.is_inherited_method_name}}()) 126 if ({{field.is_inherited_method_name}}())
127 {{setter_expression(field)}} = parentStyle.{{getter_expression(field)}}; 127 {{setter_expression(field)}} = parentStyle.{{getter_expression(field)}};
128 {% endfor %} 128 {% endfor %}
129 } 129 }
130 130
131 {% for name, groups_to_diff in diff_functions_map.items() %} 131 {% for name, groups_to_diff in diff_functions_map.items() %}
132 bool {{name}}(const ComputedStyleFinal& other) const { 132 bool {{name}}(const ComputedStyleFinal& other) const {
133 const ComputedStyleFinal& self = static_cast<const ComputedStyleFinal&>(*thi s);
133 {{fieldwise_diff(groups_to_diff)|indent(4)}} 134 {{fieldwise_diff(groups_to_diff)|indent(4)}}
134 return false; 135 return false;
135 } 136 }
136 {% endfor %} 137 {% endfor %}
137 138
138 // Fields. 139 // Fields.
139 // TODO(sashab): Remove initialFoo() static methods and update callers to 140 // TODO(sashab): Remove initialFoo() static methods and update callers to
140 // use resetFoo(), which can be more efficient. 141 // use resetFoo(), which can be more efficient.
141 142
142 {% for field in computed_style.all_fields %} 143 {% for field in computed_style.all_fields %}
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 187
187 private: 188 private:
188 {% for field in computed_style.fields %} 189 {% for field in computed_style.fields %}
189 {{declare_storage(field)}} 190 {{declare_storage(field)}}
190 {% endfor %} 191 {% endfor %}
191 }; 192 };
192 193
193 } // namespace blink 194 } // namespace blink
194 195
195 #endif // ComputedStyleBase_h 196 #endif // ComputedStyleBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698