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

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

Issue 2826653002: Generate getters/setters for some fields on groups in ComputedStyle (Closed)
Patch Set: Clean up nits prelanding 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
« no previous file with comments | « third_party/WebKit/Source/build/scripts/templates/fields/primitive.tmpl ('k') | no next file » | 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/storage_only.tmpl
diff --git a/third_party/WebKit/Source/build/scripts/templates/fields/storage_only.tmpl b/third_party/WebKit/Source/build/scripts/templates/fields/storage_only.tmpl
index 551d2cc1b6d9d37d2e5c19da37b776bc01b92c44..801fc78afeb29bea3196b1a9af93743a537b1ff7 100644
--- a/third_party/WebKit/Source/build/scripts/templates/fields/storage_only.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/fields/storage_only.tmpl
@@ -1,3 +1,22 @@
-{% macro decl_methods(field) -%}
+{% from 'fields/field.tmpl' import encode, decode, return_type, argument_type %}
+{% macro decl_public_methods(field) -%}
// Getters and setters not generated
{%- endmacro %}
+{% macro decl_protected_methods(field) -%}
+{% if field.is_bit_field %}
+{{return_type(field)}} {{field.internal_getter_method_name}}() const {
+ return {{decode(field, field.name)}};
+}
+{% else %}
+const {{return_type(field)}} {{field.internal_getter_method_name}}() const {
+ return {{decode(field, field.name)}};
+}
+{{return_type(field)}} {{field.internal_mutable_method_name}}() {
+ return {{decode(field, field.name)}};
+}
+{% endif %}
+void {{field.internal_setter_method_name}}({{argument_type(field)}} v) {
+ {{field.name}} = {{encode(field, "v")}};
+}
+{%- endmacro %}
+
« no previous file with comments | « third_party/WebKit/Source/build/scripts/templates/fields/primitive.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698