| OLD | NEW |
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {{license()}} | 2 {{license()}} |
| 3 | 3 |
| 4 #include "config.h" | 4 #include "config.h" |
| 5 #include "core/css/resolver/StyleBuilder.h" | 5 #include "core/css/resolver/StyleBuilder.h" |
| 6 | 6 |
| 7 #include "StyleBuilderFunctions.h" | 7 #include "StyleBuilderFunctions.h" |
| 8 #include "core/css/CSSProperty.h" | 8 #include "core/css/CSSProperty.h" |
| 9 #include "core/css/resolver/StyleResolverState.h" | 9 #include "core/css/resolver/StyleResolverState.h" |
| 10 | 10 |
| 11 // FIXME: currently we're just generating a switch statement, but we should | 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. | 12 // test other variations for performance once we have more properties here. |
| 13 | 13 |
| 14 namespace WebCore { | 14 namespace WebCore { |
| 15 | 15 |
| 16 void StyleBuilder::applyProperty(CSSPropertyID property, StyleResolverState& sta
te, CSSValue* value, bool isInitial, bool isInherit) { | 16 void StyleBuilder::applyProperty(CSSPropertyID property, StyleResolverState& sta
te, CSSValue* value, bool isInitial, bool isInherit) { |
| 17 switch(property) { | 17 switch(property) { |
| 18 {% for property_id, property in properties.items() | 18 {% for property_id, property in properties.items() |
| 19 if property.should_declare_functions %} | 19 if property.should_declare_functions %} |
| 20 case {{property_id}}: | 20 case {{property_id}}: |
| 21 if (isInitial) | 21 if (isInitial) |
| 22 StyleBuilderFunctions::applyInitial{{property_id}}(state); | 22 StyleBuilderFunctions::applyInitial{{property_id}}(state); |
| 23 else if (isInherit) | 23 else if (isInherit) |
| 24 StyleBuilderFunctions::applyInherit{{property_id}}(state); | 24 StyleBuilderFunctions::applyInherit{{property_id}}(state); |
| 25 else | 25 else |
| 26 StyleBuilderFunctions::applyValue{{property_id}}(state, value); | 26 StyleBuilderFunctions::applyValue{{property_id}}(state, value); |
| 27 return; | 27 return; |
| 28 | 28 |
| 29 {% endfor %} | 29 {% endfor %} |
| 30 {% for property_id, property in properties.items() if property.skip %} | 30 {% for property_id, property in properties.items() if property.sb_skip %} |
| 31 case {{property_id}}: | 31 case {{property_id}}: |
| 32 {% endfor %} | 32 {% endfor %} |
| 33 return; | 33 return; |
| 34 default: | 34 default: |
| 35 // FIXME: We should explicitly handle all cases here once we merge the v
arious .in files | |
| 36 ASSERT_NOT_REACHED(); | 35 ASSERT_NOT_REACHED(); |
| 37 } | 36 } |
| 38 } | 37 } |
| 39 | 38 |
| 40 } // namespace WebCore | 39 } // namespace WebCore |
| OLD | NEW |