Index: third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl |
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl |
index 4c8ec2878b49986a3c0f7c9078c39b2aaec4d811..292221a2eb008e52e08740c2e51e3d2cade357c2 100644 |
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl |
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.cpp.tmpl |
@@ -1,4 +1,5 @@ |
{% from 'macros.tmpl' import license %} |
+{% from 'fields/field.tmpl' import get_expr, set_expr %} |
{{license()}} |
#include "core/ComputedStyleBase.h" |
@@ -7,11 +8,15 @@ |
namespace blink { |
struct SameSizeAsComputedStyleBase { |
meade_UTC10
2017/04/06 03:29:57
Did we end up making a decision about whether or n
shend
2017/04/06 04:39:40
I think the decision with this was to make a CL to
|
- {% for field in fields|rejectattr("is_bit_field") %} |
+ {% if computed_style.subgroups is defined %} |
+ void* dataRefs[{{computed_style.subgroups|length}}]; |
+ {% endif %} |
+ {% for field in computed_style.fields|rejectattr("is_bit_field") %} |
{{field.type_name}} {{field.name}}}; |
{% endfor %} |
- unsigned m_bit_fields[{{expected_bit_field_bytes}}]; |
+ unsigned m_bit_fields[{{computed_style.num_bit_field_buckets}}]; |
}; |
+ |
// If this fails, the packing algorithm in make_computed_style_base.py has |
// failed to produce the optimal packed size. To fix, update the algorithm to |
// ensure that the buckets are placed so that each takes up at most 1 word. |
@@ -19,23 +24,23 @@ ASSERT_SIZE(ComputedStyleBase, SameSizeAsComputedStyleBase); |
void ComputedStyleBase::inheritFrom(const ComputedStyleBase& inheritParent, |
IsAtShadowBoundary isAtShadowBoundary) { |
- {% for field in fields if field.is_inherited %} |
- {{field.name}} = inheritParent.{{field.name}}; |
+ {% for field in computed_style.all_fields if field.is_inherited %} |
+ {{set_expr(field)}} = inheritParent.{{get_expr(field)}}; |
{% endfor %} |
} |
void ComputedStyleBase::copyNonInheritedFromCached( |
const ComputedStyleBase& other) { |
- {% for field in fields if (field.is_property and not field.is_inherited) or field.is_inherited_flag %} |
- {{field.name}} = other.{{field.name}}; |
+ {% for field in computed_style.all_fields if (field.is_property and not field.is_inherited) or field.is_inherited_flag %} |
+ {{set_expr(field)}} = other.{{get_expr(field)}}; |
{% endfor %} |
} |
void ComputedStyleBase::propagateIndependentInheritedProperties( |
const ComputedStyleBase& parentStyle) { |
- {% for field in fields if field.is_property and field.is_independent %} |
+ {% for field in computed_style.all_fields if field.is_property and field.is_independent %} |
if ({{field.is_inherited_method_name}}()) |
- {{field.setter_method_name}}(parentStyle.{{field.getter_method_name}}()); |
+ {{set_expr(field)}} = parentStyle.{{get_expr(field)}}; |
{% endfor %} |
} |