| OLD | NEW |
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {# | 2 {# |
| 3 This file is for property handlers which use the templating engine to | 3 This file is for property handlers which use the templating engine to |
| 4 reduce (handwritten) code duplication. | 4 reduce (handwritten) code duplication. |
| 5 | 5 |
| 6 The `properties' dict can be used to access a property's parameters in | 6 The `properties' dict can be used to access a property's parameters in |
| 7 jinja2 templates (i.e. setter, getter, initial, type_name) | 7 jinja2 templates (i.e. setter, getter, initial, type_name) |
| 8 #} | 8 #} |
| 9 #include "StyleBuilderFunctions.h" | 9 #include "StyleBuilderFunctions.h" |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 {% endif %} | 95 {% endif %} |
| 96 {% endfor %} | 96 {% endfor %} |
| 97 | 97 |
| 98 {% macro apply_animation(property_id, attribute, animation) %} | 98 {% macro apply_animation(property_id, attribute, animation) %} |
| 99 {% set vector = attribute|lower_first + "List()" %} | 99 {% set vector = attribute|lower_first + "List()" %} |
| 100 {{declare_initial_function(property_id)}} { | 100 {{declare_initial_function(property_id)}} { |
| 101 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); | 101 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); |
| 102 data.{{vector}}.clear(); | 102 data.{{vector}}.clear(); |
| 103 data.{{vector}}.append(CSS{{animation}}Data::initial{{attribute}}()); | 103 data.{{vector}}.push_back(CSS{{animation}}Data::initial{{attribute}}()); |
| 104 } | 104 } |
| 105 | 105 |
| 106 {{declare_inherit_function(property_id)}} { | 106 {{declare_inherit_function(property_id)}} { |
| 107 const CSS{{animation}}Data* parentData = state.parentStyle()->{{animation|lowe
r}}s(); | 107 const CSS{{animation}}Data* parentData = state.parentStyle()->{{animation|lowe
r}}s(); |
| 108 if (!parentData) | 108 if (!parentData) |
| 109 applyInitial{{property_id}}(state); | 109 applyInitial{{property_id}}(state); |
| 110 else | 110 else |
| 111 state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}}; | 111 state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}}; |
| 112 } | 112 } |
| 113 | 113 |
| 114 {{declare_value_function(property_id)}} { | 114 {{declare_value_function(property_id)}} { |
| 115 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); | 115 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); |
| 116 data.{{vector}}.clear(); | 116 data.{{vector}}.clear(); |
| 117 for (auto& listValue : toCSSValueList(value)) | 117 for (auto& listValue : toCSSValueList(value)) |
| 118 data.{{vector}}.append(CSSToStyleMap::mapAnimation{{attribute}}(*listValue))
; | 118 data.{{vector}}.push_back(CSSToStyleMap::mapAnimation{{attribute}}(*listValu
e)); |
| 119 } | 119 } |
| 120 {% endmacro %} | 120 {% endmacro %} |
| 121 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} | 121 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} |
| 122 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}} | 122 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}} |
| 123 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}} | 123 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}} |
| 124 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}} | 124 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}} |
| 125 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima
tion')}} | 125 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima
tion')}} |
| 126 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}} | 126 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}} |
| 127 {{apply_animation('CSSPropertyAnimationPlayState', 'PlayState', 'Animation')}} | 127 {{apply_animation('CSSPropertyAnimationPlayState', 'PlayState', 'Animation')}} |
| 128 {{apply_animation('CSSPropertyAnimationTimingFunction', 'TimingFunction', 'Anima
tion')}} | 128 {{apply_animation('CSSPropertyAnimationTimingFunction', 'TimingFunction', 'Anima
tion')}} |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 : SVG_PAINTTYPE_URI_RGBCOLOR; | 548 : SVG_PAINTTYPE_URI_RGBCOLOR; |
| 549 } | 549 } |
| 550 {{set_value(property)}}(paintType, color, url, | 550 {{set_value(property)}}(paintType, color, url, |
| 551 state.applyPropertyToRegularStyle(), | 551 state.applyPropertyToRegularStyle(), |
| 552 state.applyPropertyToVisitedLinkStyle()); | 552 state.applyPropertyToVisitedLinkStyle()); |
| 553 } | 553 } |
| 554 {% endmacro %} | 554 {% endmacro %} |
| 555 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 555 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
| 556 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 556 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
| 557 } // namespace blink | 557 } // namespace blink |
| OLD | NEW |