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

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

Issue 2879123002: Add generated InheritedDataShared 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 3519dab86a907a2a5ad940791fc8308e2c2fce20..4f688b58dd45cf5abebe4831336540acad8a7d26 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
@@ -96,6 +96,23 @@ unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
{% endfor %}
{% endmacro %}
+{% macro fieldwise_pointer_compare_inherited(group) %}
+{% for subgroup in group.subgroups %}
+ {# If every field in this subgroup is inherited, we directly compare the
+ group pointer instead. #}
+ {% if subgroup.all_fields|rejectattr("is_inherited")|list|length == 0 -%}
+ {{subgroup.member_name}}.Get() == o.{{subgroup.member_name}}.Get() &&
+ {# Otherwise, we would have to recursively generate comparison operations
+ on fields in the subgroup. #}
+ {% elif subgroup.fields|selectattr("is_inherited")|list|length > 0 -%}
+ {{fieldwise_pointer_compare_inherited(fields_to_compare)}}
+ {% endif %}
+{% endfor %}
+{% for field in group.fields if field.is_inherited -%}
+ {{getter_expression(field)}} == o.{{getter_expression(field)}} &&
+{% endfor %}
+{% endmacro %}
+
{% macro fieldwise_diff(group_to_diff) %}
{% for group in group_to_diff.subgroups %}
if ({{group.group_name}}.Get() != other.{{group.group_name}}.Get()) {

Powered by Google App Engine
This is Rietveld 408576698