Commit c8be5e36 authored by nainar's avatar nainar Committed by Commit bot

Fix ComputedStyleBase.h.tmpl to generate accessors for fields on groups

This patch fixes the jinja templates to generate accessors for fields on
groups. It then uses the generated accessors in ComputedStyle.h

https://gist.github.com/nainar/f2816c46b990a49db3e2c3990cc9cdb1/revisions

BUG=710938

Review-Url: https://codereview.chromium.org/2855583002
Cr-Commit-Position: refs/heads/master@{#468912}
parent faf6b1e5
...@@ -118,7 +118,7 @@ class CORE_EXPORT ComputedStyleBase { ...@@ -118,7 +118,7 @@ class CORE_EXPORT ComputedStyleBase {
{% endfor %} {% endfor %}
} }
{% for field in computed_style.fields %} {% for field in computed_style.all_fields %}
{% if field.field_template in ('storage_only', 'monotonic_flag', 'external') %} {% if field.field_template in ('storage_only', 'monotonic_flag', 'external') %}
// {{field.property_name}} // {{field.property_name}}
{{field_templates[field.field_template].decl_protected_methods(field)|indent(2)}} {{field_templates[field.field_template].decl_protected_methods(field)|indent(2)}}
......
...@@ -25,8 +25,8 @@ inline void {{field.resetter_method_name}}() { ...@@ -25,8 +25,8 @@ inline void {{field.resetter_method_name}}() {
{%- endmacro %} {%- endmacro %}
{% macro decl_mutable_method(field) -%} {% macro decl_mutable_method(field) -%}
{{nonconst_ref(field)}} {{field.mutable_method_name}}() const { {{nonconst_ref(field)}} {{field.internal_mutable_method_name}}() {
return {{decode(field, getter_expression(field))}}; return {{decode(field, setter_expression(field))}};
} }
{%- endmacro %} {%- endmacro %}
......
...@@ -12,5 +12,5 @@ void {{field.setter_method_name}}({{field.type_name}}&& v) { ...@@ -12,5 +12,5 @@ void {{field.setter_method_name}}({{field.type_name}}&& v) {
{% endmacro %} {% endmacro %}
{% macro decl_protected_methods(field) -%} {% macro decl_protected_methods(field) -%}
{{base.decl_mutable_getter_method(field)}} {{base.decl_mutable_method(field)}}
{%- endmacro %} {%- endmacro %}
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
{%- endmacro %} {%- endmacro %}
{% macro decl_protected_methods(field) -%} {% macro decl_protected_methods(field) -%}
{{base.decl_internal_getter_method(field)}}
{{base.decl_internal_setter_method(field)}}
{% if not field.is_bit_field -%} {% if not field.is_bit_field -%}
{{base.decl_mutable_method(field)}} {{base.decl_mutable_method(field)}}
{%- endif %} {%- endif %}
{{base.decl_internal_getter_method(field)}}
{{base.decl_internal_setter_method(field)}}
{%- endmacro %} {%- endmacro %}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment