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

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

Issue 2826653002: Generate getters/setters for some fields on groups in ComputedStyle (Closed)
Patch Set: Append Internal to all protected methods Created 3 years, 8 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 8790c220a74458dfa70c7a5238d35b8e99f6a1ab..fdf2b41d11d8f55b293f00f0e0e725fe77c450ff 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/field.tmpl
@@ -14,10 +14,26 @@ static_cast<{{field.type_name}}>({{value}})
{%- endif %}
{% endmacro %}
+{% macro getter_expression(field) %}
shend 2017/04/19 03:46:20 Hmm, these macros only make sense in the presence
nainar 2017/04/19 04:02:46 Done.
+{% if field.group_member_name -%}
+{{field.group_member_name}}->{{field.name}}
+{%- else -%}
+{{field.name}}
+{%- endif %}
+{% endmacro %}
+
+{% macro setter_expression(field) %}
+{% if field.group_member_name -%}
+{{field.group_member_name}}.Access()->{{field.name}}
+{%- else -%}
+{{field.name}}
+{%- endif %}
+{% endmacro %}
+
{% macro return_type(field) %}
{% if field.is_bit_field -%}
{{field.type_name}}
{%- else -%}
-const {{field.type_name}}&
+{{field.type_name}}&
{%- endif %}
{% endmacro %}

Powered by Google App Engine
This is Rietveld 408576698