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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const CSS{{animation}}Data* parentData = state.ParentStyle()->{{animation}}s()
; | 107 const CSS{{animation}}Data* parentData = state.ParentStyle()->{{animation}}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 DCHECK(value.IsBaseValueList()); |
117 for (auto& listValue : ToCSSValueList(value)) | 118 for (auto& listValue : ToCSSValueList(value)) |
118 data.{{vector}}.push_back(CSSToStyleMap::MapAnimation{{attribute}}(*listValu
e)); | 119 data.{{vector}}.push_back(CSSToStyleMap::MapAnimation{{attribute}}(*listValu
e)); |
119 } | 120 } |
120 {% endmacro %} | 121 {% endmacro %} |
121 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} | 122 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} |
122 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}} | 123 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}} |
123 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}} | 124 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}} |
124 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}} | 125 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}} |
125 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima
tion')}} | 126 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima
tion')}} |
126 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}} | 127 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}} |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 : SVG_PAINTTYPE_URI_RGBCOLOR; | 561 : SVG_PAINTTYPE_URI_RGBCOLOR; |
561 } | 562 } |
562 {{set_value(property)}}(paintType, color, url, | 563 {{set_value(property)}}(paintType, color, url, |
563 state.ApplyPropertyToRegularStyle(), | 564 state.ApplyPropertyToRegularStyle(), |
564 state.ApplyPropertyToVisitedLinkStyle()); | 565 state.ApplyPropertyToVisitedLinkStyle()); |
565 } | 566 } |
566 {% endmacro %} | 567 {% endmacro %} |
567 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 568 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
568 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 569 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
569 } // namespace blink | 570 } // namespace blink |
OLD | NEW |