| 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 "config.h" | 9 #include "config.h" |
| 10 #include "StyleBuilderFunctions.h" | 10 #include "StyleBuilderFunctions.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 {{apply_animation('CSSPropertyWebkitAnimationName', 'Name', 'Animation')}} | 111 {{apply_animation('CSSPropertyWebkitAnimationName', 'Name', 'Animation')}} |
| 112 {{apply_animation('CSSPropertyWebkitAnimationPlayState', 'PlayState', 'Animation
')}} | 112 {{apply_animation('CSSPropertyWebkitAnimationPlayState', 'PlayState', 'Animation
')}} |
| 113 {{apply_animation('CSSPropertyWebkitAnimationTimingFunction', 'TimingFunction',
'Animation')}} | 113 {{apply_animation('CSSPropertyWebkitAnimationTimingFunction', 'TimingFunction',
'Animation')}} |
| 114 {{apply_animation('CSSPropertyWebkitTransitionDelay', 'Delay', 'Transition')}} | 114 {{apply_animation('CSSPropertyWebkitTransitionDelay', 'Delay', 'Transition')}} |
| 115 {{apply_animation('CSSPropertyWebkitTransitionDuration', 'Duration', 'Transition
')}} | 115 {{apply_animation('CSSPropertyWebkitTransitionDuration', 'Duration', 'Transition
')}} |
| 116 {{apply_animation('CSSPropertyWebkitTransitionProperty', 'Property', 'Transition
')}} | 116 {{apply_animation('CSSPropertyWebkitTransitionProperty', 'Property', 'Transition
')}} |
| 117 {{apply_animation('CSSPropertyWebkitTransitionTimingFunction', 'TimingFunction',
'Transition')}} | 117 {{apply_animation('CSSPropertyWebkitTransitionTimingFunction', 'TimingFunction',
'Transition')}} |
| 118 | 118 |
| 119 {% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identi
ty='CSSValueAuto', compute_length=false) %} | 119 {% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identi
ty='CSSValueAuto', compute_length=false) %} |
| 120 {% set property = properties[property_id] %} | 120 {% set property = properties[property_id] %} |
| 121 {% set auto_getter = auto_getter or 'hasAuto' + property.camel_case_name %} | 121 {% set auto_getter = auto_getter or 'hasAuto' + property.name_for_methods %} |
| 122 {% set auto_setter = auto_setter or 'setHasAuto' + property.camel_case_name %} | 122 {% set auto_setter = auto_setter or 'setHasAuto' + property.name_for_methods %} |
| 123 {{declare_initial_function(property_id)}} | 123 {{declare_initial_function(property_id)}} |
| 124 { | 124 { |
| 125 state.style()->{{auto_setter}}(); | 125 state.style()->{{auto_setter}}(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 {{declare_inherit_function(property_id)}} | 128 {{declare_inherit_function(property_id)}} |
| 129 { | 129 { |
| 130 if (state.parentStyle()->{{auto_getter}}()) | 130 if (state.parentStyle()->{{auto_getter}}()) |
| 131 state.style()->{{auto_setter}}(); | 131 state.style()->{{auto_setter}}(); |
| 132 else | 132 else |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 { | 274 { |
| 275 {% set property = properties[property_id] %} | 275 {% set property = properties[property_id] %} |
| 276 {{set_value(property)}}(state.styleImage({{property_id}}, value)); | 276 {{set_value(property)}}(state.styleImage({{property_id}}, value)); |
| 277 } | 277 } |
| 278 {% endmacro %} | 278 {% endmacro %} |
| 279 {{apply_value_border_image_source('CSSPropertyBorderImageSource')}} | 279 {{apply_value_border_image_source('CSSPropertyBorderImageSource')}} |
| 280 {{apply_value_border_image_source('CSSPropertyWebkitMaskBoxImageSource')}} | 280 {{apply_value_border_image_source('CSSPropertyWebkitMaskBoxImageSource')}} |
| 281 | 281 |
| 282 {% macro apply_color(property_id, initial_color='StyleColor::currentColor') %} | 282 {% macro apply_color(property_id, initial_color='StyleColor::currentColor') %} |
| 283 {% set property = properties[property_id] %} | 283 {% set property = properties[property_id] %} |
| 284 {% set visited_link_setter = 'setVisitedLink' + property.camel_case_name %} | 284 {% set visited_link_setter = 'setVisitedLink' + property.name_for_methods %} |
| 285 {{declare_initial_function(property_id)}} | 285 {{declare_initial_function(property_id)}} |
| 286 { | 286 { |
| 287 StyleColor color = {{initial_color}}(); | 287 StyleColor color = {{initial_color}}(); |
| 288 if (state.applyPropertyToRegularStyle()) | 288 if (state.applyPropertyToRegularStyle()) |
| 289 {{set_value(property)}}(color); | 289 {{set_value(property)}}(color); |
| 290 if (state.applyPropertyToVisitedLinkStyle()) | 290 if (state.applyPropertyToVisitedLinkStyle()) |
| 291 state.style()->{{visited_link_setter}}(color); | 291 state.style()->{{visited_link_setter}}(color); |
| 292 } | 292 } |
| 293 | 293 |
| 294 {{declare_inherit_function(property_id)}} | 294 {{declare_inherit_function(property_id)}} |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 634 } |
| 635 {{set_value(property)}}(ptype, c, url, | 635 {{set_value(property)}}(ptype, c, url, |
| 636 state.applyPropertyToRegularStyle(), | 636 state.applyPropertyToRegularStyle(), |
| 637 state.applyPropertyToVisitedLinkStyle()); | 637 state.applyPropertyToVisitedLinkStyle()); |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 {% endmacro %} | 640 {% endmacro %} |
| 641 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 641 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
| 642 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 642 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
| 643 } // namespace blink | 643 } // namespace blink |
| OLD | NEW |