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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl

Issue 2869613002: Move nested classes in ComputedStyleBase outside. (Closed)
Patch Set: 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {% from 'macros.tmpl' import license, print_if %} 1 {% from 'macros.tmpl' import license, print_if %}
2 {% from 'fields/field.tmpl' import encode, getter_expression, declare_storage, f ieldwise_compare %} 2 {% from 'fields/field.tmpl' import encode, getter_expression, declare_storage, f ieldwise_compare %}
3 {% from 'fields/group.tmpl' import define_field_group_class %} 3 {% from 'fields/group.tmpl' import define_field_group_class %}
4 {{license()}} 4 {{license()}}
5 5
6 #ifndef ComputedStyleBase_h 6 #ifndef ComputedStyleBase_h
7 #define ComputedStyleBase_h 7 #define ComputedStyleBase_h
8 8
9 #include "core/style/ComputedStyleConstants.h" 9 #include "core/style/ComputedStyleConstants.h"
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 14 matching lines...) Expand all
25 {% set field_templates = { 25 {% set field_templates = {
26 'keyword': keyword, 26 'keyword': keyword,
27 'primitive': primitive, 27 'primitive': primitive,
28 'monotonic_flag': monotonic_flag, 28 'monotonic_flag': monotonic_flag,
29 'storage_only': storage_only, 29 'storage_only': storage_only,
30 'external': external 30 'external': external
31 } %} 31 } %}
32 32
33 namespace blink { 33 namespace blink {
34 34
35 {% for subgroup in computed_style.subgroups %}
36 {{define_field_group_class(subgroup)|indent(2)}}
37
38 {% endfor %}
39
35 // The generated portion of ComputedStyle. For more info, see the header comment 40 // The generated portion of ComputedStyle. For more info, see the header comment
36 // in ComputedStyle.h. 41 // in ComputedStyle.h.
37 class CORE_EXPORT ComputedStyleBase { 42 class CORE_EXPORT ComputedStyleBase {
38 public: 43 public:
39 inline bool IndependentInheritedEqual(const ComputedStyleBase& o) const { 44 inline bool IndependentInheritedEqual(const ComputedStyleBase& o) const {
40 return ( 45 return (
41 {{fieldwise_compare(computed_style, computed_style.all_fields 46 {{fieldwise_compare(computed_style, computed_style.all_fields
42 |selectattr("is_property") 47 |selectattr("is_property")
43 |selectattr("is_inherited") 48 |selectattr("is_inherited")
44 |selectattr("is_independent") 49 |selectattr("is_independent")
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 97
93 // Fields. 98 // Fields.
94 // TODO(sashab): Remove initialFoo() static methods and update callers to 99 // TODO(sashab): Remove initialFoo() static methods and update callers to
95 // use resetFoo(), which can be more efficient. 100 // use resetFoo(), which can be more efficient.
96 101
97 {% for field in computed_style.all_fields %} 102 {% for field in computed_style.all_fields %}
98 // {{field.property_name}} 103 // {{field.property_name}}
99 {{field_templates[field.field_template].decl_public_methods(field)|indent(2)}} 104 {{field_templates[field.field_template].decl_public_methods(field)|indent(2)}}
100 105
101 {% endfor %} 106 {% endfor %}
102 private:
103 {% for subgroup in computed_style.subgroups %}
104 {{define_field_group_class(subgroup)|indent(2)}}
105
106 {% endfor %}
107 107
108 protected: 108 protected:
109 // Constructor and destructor are protected so that only the parent class Comp utedStyle 109 // Constructor and destructor are protected so that only the parent class Comp utedStyle
110 // can instantiate this class. 110 // can instantiate this class.
111 ALWAYS_INLINE ComputedStyleBase() : 111 ALWAYS_INLINE ComputedStyleBase() :
112 {% for field in computed_style.fields %} 112 {% for field in computed_style.fields %}
113 {{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop. last, ',')}} 113 {{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop. last, ',')}}
114 {% endfor %} 114 {% endfor %}
115 { 115 {
116 {% for subgroup in computed_style.subgroups %} 116 {% for subgroup in computed_style.subgroups %}
(...skipping 18 matching lines...) Expand all
135 135
136 private: 136 private:
137 {% for field in computed_style.fields %} 137 {% for field in computed_style.fields %}
138 {{declare_storage(field)}} 138 {{declare_storage(field)}}
139 {% endfor %} 139 {% endfor %}
140 }; 140 };
141 141
142 } // namespace blink 142 } // namespace blink
143 143
144 #endif // ComputedStyleBase_h 144 #endif // ComputedStyleBase_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698