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

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

Issue 2879493003: Check if value changed when setting nested fields 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl b/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
index 6fc0ffbf319af76a388f1156dd29730cfc595cda..22448d82af4b6fb58c2b2f4b31fa4da783b1f197 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/base.tmpl
@@ -1,4 +1,4 @@
-{% from 'fields/field.tmpl' import encode, decode, const_ref, nonconst_ref, getter_expression, setter_expression %}
+{% from 'fields/field.tmpl' import encode, decode, const_ref, nonconst_ref, getter_expression, setter_expression, set_if_changed %}
{% macro decl_initial_method(field) -%}
inline static {{field.type_name}} {{field.initial_method_name}}() {
@@ -14,7 +14,7 @@ inline static {{field.type_name}} {{field.initial_method_name}}() {
{% macro decl_setter_method(field) -%}
void {{field.setter_method_name}}({{const_ref(field)}} v) {
- {{setter_expression(field)}} = {{encode(field, "v")}};
+ {{set_if_changed(field, encode(field, "v"))|indent(2)}}
}
{%- endmacro %}
@@ -38,6 +38,6 @@ inline void {{field.resetter_method_name}}() {
{% macro decl_internal_setter_method(field) -%}
void {{field.internal_setter_method_name}}({{const_ref(field)}} v) {
- {{setter_expression(field)}} = {{encode(field, "v")}};
+ {{set_if_changed(field, encode(field, "v"))|indent(2)}}
}
{%- endmacro %}
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/fields/external.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698