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

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 07b493cda245ea2a0aae6734f7882d93568b4e4f..8f0d15d8ca90b30cf9ec2095c01454c4aa62cd36 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) %}
+{% 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. #}
@@ -79,7 +87,7 @@ unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
{% endif %}
{% endfor %}
{% for field in group.fields|select("in", fields_to_compare) -%}
- {{getter_expression(field)}} == o.{{getter_expression(field)}} &&
+ {{compare(field.wrapper_pointer_name, getter_expression(field), "o")}} &&
{% endfor %}
{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698