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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl

Issue 2858863002: Add macro to diff the groups (and their members) in ComputedStyleBase (Closed)
Patch Set: use results from diff functions generated in ComputedStyleBase.cpp in ComputedStyle.cpp 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 {% macro encode(field, value) %} 1 {% macro encode(field, value) %}
2 {% if field.is_bit_field -%} 2 {% if field.is_bit_field -%}
3 static_cast<unsigned>({{value}}) 3 static_cast<unsigned>({{value}})
4 {%- else -%} 4 {%- else -%}
5 {{value}} 5 {{value}}
6 {%- endif %} 6 {%- endif %}
7 {% endmacro %} 7 {% endmacro %}
8 8
9 {% macro decode(field, value) %} 9 {% macro decode(field, value) %}
10 {% if field.is_bit_field -%} 10 {% if field.is_bit_field -%}
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 {% if subgroup.all_fields|reject("in", fields_to_copy)|list|length == 0 -%} 79 {% if subgroup.all_fields|reject("in", fields_to_copy)|list|length == 0 -%}
80 {{subgroup.member_name}} = other.{{subgroup.member_name}}; 80 {{subgroup.member_name}} = other.{{subgroup.member_name}};
81 {% elif subgroup.fields|select("in", fields_to_copy)|list|length > 0 -%} 81 {% elif subgroup.fields|select("in", fields_to_copy)|list|length > 0 -%}
82 {{fieldwise_copy(subgroup, fields_to_copy)}} 82 {{fieldwise_copy(subgroup, fields_to_copy)}}
83 {% endif %} 83 {% endif %}
84 {% endfor %} 84 {% endfor %}
85 {% for field in group.fields|select("in", fields_to_copy) -%} 85 {% for field in group.fields|select("in", fields_to_copy) -%}
86 {{setter_expression(field)}} = other.{{getter_expression(field)}}; 86 {{setter_expression(field)}} = other.{{getter_expression(field)}};
87 {% endfor %} 87 {% endfor %}
88 {% endmacro %} 88 {% endmacro %}
89
90 {% macro fieldwise_diff(group, fields_to_diff) %}
91 {% for subgroup in group.subgroups %}
92 {% if subgroup.all_fields|select("in", fields_to_diff)|list|length > 0 -%}
meade_UTC10 2017/05/04 04:51:30 nit: Could we please do indenting for nested contr
93 if ({{subgroup.member_name}}.Get() != other.{{subgroup.member_name}}.Get()) {
94 {{fieldwise_diff(subgroup, fields_to_diff)|indent(2, true)}}
95 }
96 {% endif -%}
97 {% endfor %}
98 {% for field in group.fields|select("in", fields_to_diff) %}
99 if ({{getter_expression(field)}} != other.{{getter_expression(field)}})
100 return true;
101 {% endfor %}
102 {% endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698