| Index: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl
|
| diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl
|
| index 2e4535c08ee31b6c580001937464cb279c076361..03c41f806b1ffcbf6a6684d4a31b657dcae75142 100644
|
| --- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl
|
| +++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBaseConstants.h.tmpl
|
| @@ -1,4 +1,4 @@
|
| -{% from 'macros.tmpl' import license %}
|
| +{% from 'macros.tmpl' import license, print_if %}
|
| {{license()}}
|
|
|
| #ifndef ComputedStyleBaseConstants_h
|
| @@ -9,13 +9,28 @@ namespace blink {
|
| // TODO(sashab): Move these enums to their own namespace, or add a CSS prefix,
|
| // for consistency and to prevent name conflicts.
|
|
|
| -{% for enum_name, enum_values in enums.items() %}
|
| -enum class {{enum_name}} : unsigned {
|
| - {% for enum_value in enum_values %}
|
| - {{enum_value}},
|
| +{% for enum in enums %}
|
| +enum class {{enum.type_name}} : unsigned {
|
| + {% for value in enum.values %}
|
| + {{value}}{{print_if(enum.is_set, " = " ~ (0 if loop.first else 2**loop.index0))}},
|
| {% endfor %}
|
| };
|
|
|
| +{% if enum.is_set %}
|
| +static const int k{{enum.type_name}}Bits = {{enum.values|length - 1}};
|
| +
|
| +{% for op in ('|', '^') %}
|
| +inline {{enum.type_name}} operator{{op}}({{enum.type_name}} a, {{enum.type_name}} b) {
|
| + return static_cast<{{enum.type_name}}>(
|
| + static_cast<unsigned>(a) {{op}} static_cast<unsigned>(b)
|
| + );
|
| +}
|
| +inline {{enum.type_name}}& operator{{op}}=({{enum.type_name}}& a, {{enum.type_name}} b) {
|
| + return a = a {{op}} b;
|
| +}
|
| +
|
| +{% endfor %}
|
| +{% endif %}
|
| {% endfor %}
|
| } // namespace blink
|
|
|
|
|