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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'fields/field.tmpl' import encode, decode, const_ref, nonconst_ref, gett er_expression, setter_expression %} 1 {% from 'fields/field.tmpl' import encode, decode, const_ref, nonconst_ref, gett er_expression, setter_expression, set_if_changed %}
2 2
3 {% macro decl_initial_method(field) -%} 3 {% macro decl_initial_method(field) -%}
4 inline static {{field.type_name}} {{field.initial_method_name}}() { 4 inline static {{field.type_name}} {{field.initial_method_name}}() {
5 return {{field.default_value}}; 5 return {{field.default_value}};
6 } 6 }
7 {%- endmacro %} 7 {%- endmacro %}
8 8
9 {% macro decl_getter_method(field) -%} 9 {% macro decl_getter_method(field) -%}
10 {{const_ref(field)}} {{field.getter_method_name}}() const { 10 {{const_ref(field)}} {{field.getter_method_name}}() const {
11 return {{decode(field, getter_expression(field))}}; 11 return {{decode(field, getter_expression(field))}};
12 } 12 }
13 {%- endmacro %} 13 {%- endmacro %}
14 14
15 {% macro decl_setter_method(field) -%} 15 {% macro decl_setter_method(field) -%}
16 void {{field.setter_method_name}}({{const_ref(field)}} v) { 16 void {{field.setter_method_name}}({{const_ref(field)}} v) {
17 {{setter_expression(field)}} = {{encode(field, "v")}}; 17 {{set_if_changed(field, encode(field, "v"))|indent(2)}}
18 } 18 }
19 {%- endmacro %} 19 {%- endmacro %}
20 20
21 {% macro decl_resetter_method(field) -%} 21 {% macro decl_resetter_method(field) -%}
22 inline void {{field.resetter_method_name}}() { 22 inline void {{field.resetter_method_name}}() {
23 {{setter_expression(field)}} = {{encode(field, field.default_value)}}; 23 {{setter_expression(field)}} = {{encode(field, field.default_value)}};
24 } 24 }
25 {%- endmacro %} 25 {%- endmacro %}
26 26
27 {% macro decl_mutable_method(field) -%} 27 {% macro decl_mutable_method(field) -%}
28 {{nonconst_ref(field)}} {{field.internal_mutable_method_name}}() { 28 {{nonconst_ref(field)}} {{field.internal_mutable_method_name}}() {
29 return {{decode(field, setter_expression(field))}}; 29 return {{decode(field, setter_expression(field))}};
30 } 30 }
31 {%- endmacro %} 31 {%- endmacro %}
32 32
33 {% macro decl_internal_getter_method(field) -%} 33 {% macro decl_internal_getter_method(field) -%}
34 {{const_ref(field)}} {{field.internal_getter_method_name}}() const { 34 {{const_ref(field)}} {{field.internal_getter_method_name}}() const {
35 return {{decode(field, getter_expression(field))}}; 35 return {{decode(field, getter_expression(field))}};
36 } 36 }
37 {%- endmacro %} 37 {%- endmacro %}
38 38
39 {% macro decl_internal_setter_method(field) -%} 39 {% macro decl_internal_setter_method(field) -%}
40 void {{field.internal_setter_method_name}}({{const_ref(field)}} v) { 40 void {{field.internal_setter_method_name}}({{const_ref(field)}} v) {
41 {{setter_expression(field)}} = {{encode(field, "v")}}; 41 {{set_if_changed(field, encode(field, "v"))|indent(2)}}
42 } 42 }
43 {%- endmacro %} 43 {%- endmacro %}
OLDNEW
« 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