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

Unified 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, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl b/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
index ff20cf6ed7180fb05620e3236b94254183c67165..f029a40e5c487708e30fb14dce93c5d416ef31a6 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
@@ -86,3 +86,17 @@ unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
{{setter_expression(field)}} = other.{{getter_expression(field)}};
{% endfor %}
{% endmacro %}
+
+{% macro fieldwise_diff(group, fields_to_diff) %}
+{% for subgroup in group.subgroups %}
+{% 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
+if ({{subgroup.member_name}}.Get() != other.{{subgroup.member_name}}.Get()) {
+{{fieldwise_diff(subgroup, fields_to_diff)|indent(2, true)}}
+}
+{% endif -%}
+{% endfor %}
+{% for field in group.fields|select("in", fields_to_diff) %}
+if ({{getter_expression(field)}} != other.{{getter_expression(field)}})
+ return true;
+{% endfor %}
+{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698