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

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

Issue 2900253002: Split has_custom_compare_and_copy in ComputedStyleExtraFields.json5. (Closed)
Patch Set: Rebase 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 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 1538c97f0640928df413dcd2211396e7751f649f..74fcdeb6584a9243cfc6cd7282d286417b11e426 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
@@ -78,28 +78,28 @@ unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
{% for subgroup in group.subgroups %}
{# If every field in this subgroup is to be compared, we can compare the
group pointer instead. #}
- {% if subgroup.all_fields|reject("in", fields_to_compare)|list|length == 0 -%}
+ {% if subgroup.all_fields|rejectattr("custom_compare")|reject("in", fields_to_compare)|list|length == 0 -%}
{{subgroup.member_name}} == o.{{subgroup.member_name}} &&
{# Otherwise, we would have to recursively generate comparison operations
on fields in the subgroup. #}
- {% elif subgroup.fields|select("in", fields_to_compare)|list|length > 0 -%}
+ {% elif subgroup.fields|rejectattr("custom_compare")|select("in", fields_to_compare)|list|length > 0 -%}
{{fieldwise_compare(subgroup, fields_to_compare)}}
{% endif %}
{% endfor %}
-{% for field in group.fields|select("in", fields_to_compare) -%}
+{% for field in group.fields|rejectattr("custom_compare")|select("in", fields_to_compare) -%}
{{compare(field.wrapper_pointer_name, getter_expression(field), "o")}} &&
{% endfor %}
{% endmacro %}
{% macro fieldwise_copy(group, fields_to_copy) %}
{% for subgroup in group.subgroups %}
- {% if subgroup.all_fields|reject("in", fields_to_copy)|list|length == 0 -%}
+ {% if subgroup.all_fields|rejectattr("custom_copy")|reject("in", fields_to_copy)|list|length == 0 -%}
{{subgroup.member_name}} = other.{{subgroup.member_name}};
- {% elif subgroup.fields|select("in", fields_to_copy)|list|length > 0 -%}
+ {% elif subgroup.fields|rejectattr("custom_copy")|select("in", fields_to_copy)|list|length > 0 -%}
{{fieldwise_copy(subgroup, fields_to_copy)}}
{% endif %}
{% endfor %}
-{% for field in group.fields|select("in", fields_to_copy) -%}
+{% for field in group.fields|rejectattr("custom_copy")|select("in", fields_to_copy) -%}
{{setter_expression(field)}} = other.{{getter_expression(field)}};
{% endfor %}
{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698