1 {% from 'macros.tmpl' import license %}
5 #include "core/css/resolver/StyleBuilder.h"
7 #include "StyleBuilderFunctions.h"
8 #include "core/css/CSSProperty.h"
9 #include "core/css/resolver/StyleResolverState.h"
11 // FIXME: currently we're just generating a switch statement, but we should
12 // test other variations for performance once we have more properties here.
16 void StyleBuilder::applyProperty(CSSPropertyID property, StyleResolverState& state, CSSValue* value, bool isInitial, bool isInherit) {
18 {% for property_id, property in properties.items()
19 if property.should_declare_functions or property.use_handlers_for %}
20 {% set used_property = properties[property.use_handlers_for] or property %}
21 {% set used_property_id = used_property.property_id %}
24 StyleBuilderFunctions::applyInitial{{used_property_id}}(state);
26 StyleBuilderFunctions::applyInherit{{used_property_id}}(state);
28 StyleBuilderFunctions::applyValue{{used_property_id}}(state, value);
32 {% for property_id, property in properties.items() if property.direction_aware %}
36 CSSPropertyID resolvedProperty = CSSProperty::resolveDirectionAwareProperty(property, state.style()->direction(), state.style()->writingMode());
37 ASSERT(resolvedProperty != property);
38 applyProperty(resolvedProperty, state, value);
41 {% for property_id, property in properties.items() if property.builder_skip %}