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

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

Issue 2887333003: Generate StyleRareInheritedData in ComputedStyleBase. (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 f09fc2b5068ceb312eab707f67a312ea849c6d08..e253b78c26e9ece39b31f5da6c1f96443638af44 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
@@ -63,6 +63,14 @@ unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
{%- endif %}
{% endmacro %}
+{% macro compare(is_pointer_type, expr, other_name) %}
nainar 2017/05/21 23:59:35 The comparisons in the generated diff attached see
shend 2017/05/22 00:19:19 Done.
+{% if is_pointer_type -%}
+ DataEquivalent({{expr}}, {{other_name}}.{{expr}})
+{%- else -%}
+ {{expr}} == {{other_name}}.{{expr}}
+{%- endif %}
+{% endmacro %}
+
{# Given a group and a list of fields to compare, this generates a set of
equality comparisons on those fields. The generated comparisons take
advantage of group sharing. #}
@@ -78,8 +86,8 @@ unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
{{fieldwise_compare(subgroup, fields_to_compare)}}
{% endif %}
{% endfor %}
-{% for field in group.fields|select("in", fields_to_compare) -%}
- {{getter_expression(field)}} == o.{{getter_expression(field)}} &&
+{% for field in group.fields|select("in", fields_to_compare) %}
+ {{compare(field.pointer_type_name, getter_expression(field), "o")}} &&
{% endfor %}
{% endmacro %}
@@ -123,4 +131,4 @@ if ({{group.group_name}}.Get() != other.{{group.group_name}}.Get()) {
if (self.{{expression}} != other.{{expression}})
return true;
{% endfor %}
-{% endmacro %}
+{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698