Index: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
index e04e7af7fcb29636993954b3d13150bd84d76a69..f415b99066e928cf4bbdcd0e6cc7451e2e4fe961 100644 |
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl |
@@ -1,4 +1,6 @@ |
{% from 'macros.tmpl' import license, print_if %} |
+{% from 'fields/field.tmpl' import encode, get_expr, set_expr %} |
+{% from 'fields/group.tmpl' import def_group %} |
{{license()}} |
#ifndef ComputedStyleBase_h |
@@ -6,6 +8,7 @@ |
#include "core/style/ComputedStyleConstants.h" |
#include "core/CoreExport.h" |
+#include "core/style/DataRef.h" |
{% for path in include_paths %} |
#include "{{path}}" |
{% endfor %} |
@@ -35,16 +38,16 @@ class CORE_EXPORT ComputedStyleBase { |
public: |
inline bool independentInheritedEqual(const ComputedStyleBase& o) const { |
return ( |
- {% for field in fields if field.is_inherited and field.is_independent %} |
- {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} |
+ {% for field in computed_style.all_fields if field.is_inherited and field.is_independent %} |
+ {{get_expr(field)}} == o.{{get_expr(field)}}{{print_if(not loop.last, ' &&')}} |
{% endfor %} |
); |
} |
inline bool nonIndependentInheritedEqual(const ComputedStyleBase& o) const { |
return ( |
- {% for field in fields if field.is_inherited and not field.is_independent %} |
- {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} |
+ {% for field in computed_style.all_fields if field.is_inherited and not field.is_independent %} |
+ {{get_expr(field)}} == o.{{get_expr(field)}}{{print_if(not loop.last, ' &&')}} |
{% endfor %} |
); |
} |
@@ -55,8 +58,8 @@ class CORE_EXPORT ComputedStyleBase { |
inline bool nonInheritedEqual(const ComputedStyleBase& o) const { |
return ( |
- {% for field in fields if field.is_property and not field.is_inherited %} |
- {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}} |
+ {% for field in computed_style.all_fields if field.is_property and not field.is_inherited %} |
+ {{get_expr(field)}} == o.{{get_expr(field)}}{{print_if(not loop.last, ' &&')}} |
{% endfor %} |
); |
} |
@@ -79,24 +82,38 @@ class CORE_EXPORT ComputedStyleBase { |
// TODO(sashab): Remove initialFoo() static methods and update callers to |
// use resetFoo(), which can be more efficient. |
- {% for field in fields %} |
+ {% for field in computed_style.all_fields %} |
// {{field.property_name}} |
{{field_templates[field.field_template].decl_methods(field)|indent(2)}} |
{% endfor %} |
+ private: |
+ {% for subgroup in computed_style.subgroups %} |
+ {{def_group(subgroup)|indent(2)}} |
+ |
+ {% endfor %} |
+ |
protected: |
// Constructor and destructor are protected so that only the parent class ComputedStyle |
// can instantiate this class. |
ALWAYS_INLINE ComputedStyleBase() : |
- {% for field in fields %} |
+ {% for field in computed_style.fields %} |
{{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop.last, ',')}} |
{% endfor %} |
- {} |
+ { |
+ {% for subgroup in computed_style.subgroups %} |
+ {{subgroup.member_name}}.init(); |
+ {% endfor %} |
+ } |
~ComputedStyleBase() = default; |
// Storage. |
- {% for field in fields %} |
+ {% for subgroup in computed_style.subgroups %} |
+ DataRef<{{subgroup.type_name}}> {{subgroup.member_name}}; |
+ {% endfor %} |
+ |
+ {% for field in computed_style.fields %} |
{% if field.is_bit_field %} |
unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} |
{% else %} |