| OLD | NEW |
| 1 {% from 'macros.tmpl' import license, print_if %} | 1 {% from 'macros.tmpl' import license, print_if %} |
| 2 {{license()}} | 2 {{license()}} |
| 3 | 3 |
| 4 #ifndef ComputedStyleBase_h | 4 #ifndef ComputedStyleBase_h |
| 5 #define ComputedStyleBase_h | 5 #define ComputedStyleBase_h |
| 6 | 6 |
| 7 #include "core/style/ComputedStyleConstants.h" | 7 #include "core/style/ComputedStyleConstants.h" |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 {% for path in include_paths %} | 9 {% for path in include_paths %} |
| 10 #include "{{path}}" | 10 #include "{{path}}" |
| 11 {% endfor %} | 11 {% endfor %} |
| 12 | 12 |
| 13 {# Each field template has macros that we can call to generate specific | 13 {# Each field template has macros that we can call to generate specific |
| 14 aspects of the field (e.g. getters, setters). | 14 aspects of the field (e.g. getters, setters). |
| 15 #} | 15 #} |
| 16 {% import 'fields/keyword.tmpl' as keyword %} | 16 {% import 'fields/keyword.tmpl' as keyword %} |
| 17 {% import 'fields/flag.tmpl' as flag %} | 17 {% import 'fields/flag.tmpl' as flag %} |
| 18 {% import 'fields/monotonic_flag.tmpl' as monotonic_flag %} | 18 {% import 'fields/monotonic_flag.tmpl' as monotonic_flag %} |
| 19 {% import 'fields/storage_only.tmpl' as storage_only %} | 19 {% import 'fields/storage_only.tmpl' as storage_only %} |
| 20 {% import 'fields/external.tmpl' as external %} |
| 21 {% from 'fields/field.tmpl' import encode %} |
| 20 {% set field_templates = { | 22 {% set field_templates = { |
| 21 'keyword': keyword, 'flag': flag, 'monotonic_flag': monotonic_flag, 'storag
e_only': storage_only | 23 'keyword': keyword, |
| 24 'flag': flag, |
| 25 'monotonic_flag': monotonic_flag, |
| 26 'storage_only': storage_only, |
| 27 'external': external |
| 22 } %} | 28 } %} |
| 23 | 29 |
| 24 namespace blink { | 30 namespace blink { |
| 25 | 31 |
| 26 // The generated portion of ComputedStyle. For more info, see the header comment | 32 // The generated portion of ComputedStyle. For more info, see the header comment |
| 27 // in ComputedStyle.h. | 33 // in ComputedStyle.h. |
| 28 class CORE_EXPORT ComputedStyleBase { | 34 class CORE_EXPORT ComputedStyleBase { |
| 29 public: | 35 public: |
| 30 inline bool independentInheritedEqual(const ComputedStyleBase& o) const { | 36 inline bool independentInheritedEqual(const ComputedStyleBase& o) const { |
| 31 return ( | 37 return ( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 {% for field in fields %} | 82 {% for field in fields %} |
| 77 // {{field.property_name}} | 83 // {{field.property_name}} |
| 78 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} | 84 {{field_templates[field.field_template].decl_methods(field)|indent(2)}} |
| 79 | 85 |
| 80 {% endfor %} | 86 {% endfor %} |
| 81 protected: | 87 protected: |
| 82 // Constructor and destructor are protected so that only the parent class Comp
utedStyle | 88 // Constructor and destructor are protected so that only the parent class Comp
utedStyle |
| 83 // can instantiate this class. | 89 // can instantiate this class. |
| 84 ALWAYS_INLINE ComputedStyleBase() : | 90 ALWAYS_INLINE ComputedStyleBase() : |
| 85 {% for field in fields %} | 91 {% for field in fields %} |
| 86 {{field.name}}(static_cast<unsigned>({{field.default_value}})){{print_if(n
ot loop.last, ',')}} | 92 {{field.name}}({{encode(field, field.default_value)}}){{print_if(not loop.
last, ',')}} |
| 87 {% endfor %} | 93 {% endfor %} |
| 88 {} | 94 {} |
| 89 | 95 |
| 90 ~ComputedStyleBase() = default; | 96 ~ComputedStyleBase() = default; |
| 91 | 97 |
| 92 // Storage. | 98 // Storage. |
| 93 {% for field in fields %} | 99 {% for field in fields %} |
| 100 {% if field.is_bit_field %} |
| 94 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} | 101 unsigned {{field.name}} : {{field.size}}; // {{field.type_name}} |
| 102 {% else %} |
| 103 {{field.type_name}} {{field.name}}; |
| 104 {% endif %} |
| 95 {% endfor %} | 105 {% endfor %} |
| 96 }; | 106 }; |
| 97 | 107 |
| 98 } // namespace blink | 108 } // namespace blink |
| 99 | 109 |
| 100 #endif // ComputedStyleBase_h | 110 #endif // ComputedStyleBase_h |
| OLD | NEW |