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

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/fields/group.tmpl

Issue 2786883002: Generate subgroup StyleSurroundData in ComputedStyle. (Closed)
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
(Empty)
1 {% from 'fields/field.tmpl' import encode %}
2 {% from 'macros.tmpl' import print_if %}
3 {% macro def_group(group): -%}
meade_UTC10 2017/04/06 03:29:57 I think this can be named more clearly, group_clas
shend 2017/04/20 03:22:34 Changed to define_field_group_class.
4 class {{group.type_name}} : public RefCounted<{{group.type_name}}> {
5 public:
6 static PassRefPtr<{{group.type_name}}> create() {
7 return adoptRef(new {{group.type_name}});
8 }
9 PassRefPtr<{{group.type_name}}> copy() const {
10 return adoptRef(new {{group.type_name}}(*this));
11 }
12
13 bool operator==(const {{group.type_name}}& o) const {
meade_UTC10 2017/04/06 03:29:57 Not sure if the other generators you've written mi
shend 2017/04/06 04:39:40 Ah ok, I was merely following the handwritten code
meade_UTC10 2017/04/20 03:08:40 Ah yeah I think some of that is old and predates t
shend 2017/04/20 03:22:34 Changed to 'other'.
14 return (
15 {% for field in group.fields %}
16 {{field.name}} == o.{{field.name}}{{print_if(not loop.last, ' &&')}}
17 {% endfor %}
18 );
19 }
20 bool operator!=(const {{group.type_name}}& o) const { return !(*this == o); }
21
22 {% for field in group.fields %}
23 {% if field.is_bit_field %}
meade_UTC10 2017/04/06 03:29:58 How come some of the if field.is_bit_field is abst
shend 2017/04/20 03:22:34 Done.
24 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
25 {% else %}
26 {{field.type_name}} {{field.name}};
27 {% endif %}
28 {% endfor %}
29
30 private:
31 {{group.type_name}}() :
32 {% for field in group.fields %}
33 {{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop. last, ',')}}
34 {% endfor %}
35 {}
36
37 ALWAYS_INLINE {{group.type_name}}(const {{group.type_name}}& o) :
38 RefCounted<{{group.type_name}}>(),
39 {% for field in group.fields %}
40 {{field.name}}(o.{{field.name}}){{print_if(not loop.last, ',')}}
41 {% endfor %}
42 {}
43 };
44 {%- endmacro %}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698