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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 {{declare_value_function(property_id)}} | 95 {{declare_value_function(property_id)}} |
96 { | 96 { |
97 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); | 97 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); |
98 data.{{vector}}.clear(); | 98 data.{{vector}}.clear(); |
99 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) | 99 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) |
100 data.{{vector}}.append(state.styleMap().mapAnimation{{attribute}}(i.valu
e())); | 100 data.{{vector}}.append(state.styleMap().mapAnimation{{attribute}}(i.valu
e())); |
101 } | 101 } |
102 {% endmacro %} | 102 {% endmacro %} |
103 {{apply_animation('CSSPropertyWebkitAnimationDelay', 'Delay', 'Animation')}} | 103 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} |
104 {{apply_animation('CSSPropertyWebkitAnimationDirection', 'Direction', 'Animation
')}} | 104 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}} |
105 {{apply_animation('CSSPropertyWebkitAnimationDuration', 'Duration', 'Animation')
}} | 105 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}} |
106 {{apply_animation('CSSPropertyWebkitAnimationFillMode', 'FillMode', 'Animation')
}} | 106 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}} |
107 {{apply_animation('CSSPropertyWebkitAnimationIterationCount', 'IterationCount',
'Animation')}} | 107 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima
tion')}} |
108 {{apply_animation('CSSPropertyWebkitAnimationName', 'Name', 'Animation')}} | 108 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}} |
109 {{apply_animation('CSSPropertyWebkitAnimationPlayState', 'PlayState', 'Animation
')}} | 109 {{apply_animation('CSSPropertyAnimationPlayState', 'PlayState', 'Animation')}} |
110 {{apply_animation('CSSPropertyWebkitAnimationTimingFunction', 'TimingFunction',
'Animation')}} | 110 {{apply_animation('CSSPropertyAnimationTimingFunction', 'TimingFunction', 'Anima
tion')}} |
111 {{apply_animation('CSSPropertyWebkitTransitionDelay', 'Delay', 'Transition')}} | 111 {{apply_animation('CSSPropertyTransitionDelay', 'Delay', 'Transition')}} |
112 {{apply_animation('CSSPropertyWebkitTransitionDuration', 'Duration', 'Transition
')}} | 112 {{apply_animation('CSSPropertyTransitionDuration', 'Duration', 'Transition')}} |
113 {{apply_animation('CSSPropertyWebkitTransitionProperty', 'Property', 'Transition
')}} | 113 {{apply_animation('CSSPropertyTransitionProperty', 'Property', 'Transition')}} |
114 {{apply_animation('CSSPropertyWebkitTransitionTimingFunction', 'TimingFunction',
'Transition')}} | 114 {{apply_animation('CSSPropertyTransitionTimingFunction', 'TimingFunction', 'Tran
sition')}} |
115 | 115 |
116 {% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identi
ty='CSSValueAuto') %} | 116 {% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identi
ty='CSSValueAuto') %} |
117 {% set property = properties[property_id] %} | 117 {% set property = properties[property_id] %} |
118 {% set auto_getter = auto_getter or 'hasAuto' + property.name_for_methods %} | 118 {% set auto_getter = auto_getter or 'hasAuto' + property.name_for_methods %} |
119 {% set auto_setter = auto_setter or 'setHasAuto' + property.name_for_methods %} | 119 {% set auto_setter = auto_setter or 'setHasAuto' + property.name_for_methods %} |
120 {{declare_initial_function(property_id)}} | 120 {{declare_initial_function(property_id)}} |
121 { | 121 { |
122 state.style()->{{auto_setter}}(); | 122 state.style()->{{auto_setter}}(); |
123 } | 123 } |
124 | 124 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second
()); | 473 state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second
()); |
474 } else { | 474 } else { |
475 state.style()->set{{alignment_type}}(*primitiveValue); | 475 state.style()->set{{alignment_type}}(*primitiveValue); |
476 } | 476 } |
477 } | 477 } |
478 {% endmacro %} | 478 {% endmacro %} |
479 {{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} | 479 {{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} |
480 {{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} | 480 {{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} |
481 | 481 |
482 } // namespace blink | 482 } // namespace blink |
OLD | NEW |