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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 applyInitial{{property_id}}(state); | 96 applyInitial{{property_id}}(state); |
97 else | 97 else |
98 state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}
}; | 98 state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}
}; |
99 } | 99 } |
100 | 100 |
101 {{declare_value_function(property_id)}} | 101 {{declare_value_function(property_id)}} |
102 { | 102 { |
103 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); | 103 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); |
104 data.{{vector}}.clear(); | 104 data.{{vector}}.clear(); |
105 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) | 105 for (CSSValueListIterator i = value; i.hasMore(); i.advance()) |
106 data.{{vector}}.append(state.styleMap().mapAnimation{{attribute}}(i.valu
e())); | 106 data.{{vector}}.append(CSSToStyleMap::mapAnimation{{attribute}}(i.value(
))); |
107 } | 107 } |
108 {% endmacro %} | 108 {% endmacro %} |
109 {{apply_animation('CSSPropertyWebkitAnimationDelay', 'Delay', 'Animation')}} | 109 {{apply_animation('CSSPropertyWebkitAnimationDelay', 'Delay', 'Animation')}} |
110 {{apply_animation('CSSPropertyWebkitAnimationDirection', 'Direction', 'Animation
')}} | 110 {{apply_animation('CSSPropertyWebkitAnimationDirection', 'Direction', 'Animation
')}} |
111 {{apply_animation('CSSPropertyWebkitAnimationDuration', 'Duration', 'Animation')
}} | 111 {{apply_animation('CSSPropertyWebkitAnimationDuration', 'Duration', 'Animation')
}} |
112 {{apply_animation('CSSPropertyWebkitAnimationFillMode', 'FillMode', 'Animation')
}} | 112 {{apply_animation('CSSPropertyWebkitAnimationFillMode', 'FillMode', 'Animation')
}} |
113 {{apply_animation('CSSPropertyWebkitAnimationIterationCount', 'IterationCount',
'Animation')}} | 113 {{apply_animation('CSSPropertyWebkitAnimationIterationCount', 'IterationCount',
'Animation')}} |
114 {{apply_animation('CSSPropertyWebkitAnimationName', 'Name', 'Animation')}} | 114 {{apply_animation('CSSPropertyWebkitAnimationName', 'Name', 'Animation')}} |
115 {{apply_animation('CSSPropertyWebkitAnimationPlayState', 'PlayState', 'Animation
')}} | 115 {{apply_animation('CSSPropertyWebkitAnimationPlayState', 'PlayState', 'Animation
')}} |
116 {{apply_animation('CSSPropertyWebkitAnimationTimingFunction', 'TimingFunction',
'Animation')}} | 116 {{apply_animation('CSSPropertyWebkitAnimationTimingFunction', 'TimingFunction',
'Animation')}} |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 {% elif modifier_type == 'Width' %} | 242 {% elif modifier_type == 'Width' %} |
243 image.copyBorderSlicesFrom(state.parentStyle()->{{getter}}()); | 243 image.copyBorderSlicesFrom(state.parentStyle()->{{getter}}()); |
244 {% endif %} | 244 {% endif %} |
245 state.style()->{{setter}}(image); | 245 state.style()->{{setter}}(image); |
246 } | 246 } |
247 | 247 |
248 {{declare_value_function(property_id)}} | 248 {{declare_value_function(property_id)}} |
249 { | 249 { |
250 NinePieceImage image(state.style()->{{getter}}()); | 250 NinePieceImage image(state.style()->{{getter}}()); |
251 {% if modifier_type == 'Outset' %} | 251 {% if modifier_type == 'Outset' %} |
252 image.setOutset(state.styleMap().mapNinePieceImageQuad(value)); | 252 image.setOutset(CSSToStyleMap::mapNinePieceImageQuad(state, value)); |
253 {% elif modifier_type == 'Repeat' %} | 253 {% elif modifier_type == 'Repeat' %} |
254 state.styleMap().mapNinePieceImageRepeat(value, image); | 254 CSSToStyleMap::mapNinePieceImageRepeat(state, value, image); |
255 {% elif modifier_type == 'Slice' %} | 255 {% elif modifier_type == 'Slice' %} |
256 state.styleMap().mapNinePieceImageSlice(value, image); | 256 CSSToStyleMap::mapNinePieceImageSlice(state, value, image); |
257 {% elif modifier_type == 'Width' %} | 257 {% elif modifier_type == 'Width' %} |
258 image.setBorderSlices(state.styleMap().mapNinePieceImageQuad(value)); | 258 image.setBorderSlices(CSSToStyleMap::mapNinePieceImageQuad(state, value)); |
259 {% endif %} | 259 {% endif %} |
260 state.style()->{{setter}}(image); | 260 state.style()->{{setter}}(image); |
261 } | 261 } |
262 {% endmacro %} | 262 {% endmacro %} |
263 {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}} | 263 {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}} |
264 {{apply_border_image_modifier('CSSPropertyBorderImageRepeat', 'Repeat')}} | 264 {{apply_border_image_modifier('CSSPropertyBorderImageRepeat', 'Repeat')}} |
265 {{apply_border_image_modifier('CSSPropertyBorderImageSlice', 'Slice')}} | 265 {{apply_border_image_modifier('CSSPropertyBorderImageSlice', 'Slice')}} |
266 {{apply_border_image_modifier('CSSPropertyBorderImageWidth', 'Width')}} | 266 {{apply_border_image_modifier('CSSPropertyBorderImageWidth', 'Width')}} |
267 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageOutset', 'Outset')}} | 267 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageOutset', 'Outset')}} |
268 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageRepeat', 'Repeat')}} | 268 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageRepeat', 'Repeat')}} |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 {{declare_value_function(property_id)}} | 416 {{declare_value_function(property_id)}} |
417 { | 417 { |
418 FillLayer* currChild = &state.style()->{{access_layers}}(); | 418 FillLayer* currChild = &state.style()->{{access_layers}}(); |
419 FillLayer* prevChild = 0; | 419 FillLayer* prevChild = 0; |
420 if (value->isValueList() && !value->isImageSetValue()) { | 420 if (value->isValueList() && !value->isImageSetValue()) { |
421 /* Walk each value and put it into a layer, creating new layers as neede
d. */ | 421 /* Walk each value and put it into a layer, creating new layers as neede
d. */ |
422 CSSValueList* valueList = toCSSValueList(value); | 422 CSSValueList* valueList = toCSSValueList(value); |
423 for (unsigned int i = 0; i < valueList->length(); i++) { | 423 for (unsigned int i = 0; i < valueList->length(); i++) { |
424 if (!currChild) | 424 if (!currChild) |
425 currChild = prevChild->ensureNext(); | 425 currChild = prevChild->ensureNext(); |
426 state.styleMap().{{map_fill}}(currChild, valueList->item(i)); | 426 CSSToStyleMap::{{map_fill}}(state, currChild, valueList->item(i)); |
427 prevChild = currChild; | 427 prevChild = currChild; |
428 currChild = currChild->next(); | 428 currChild = currChild->next(); |
429 } | 429 } |
430 } else { | 430 } else { |
431 state.styleMap().{{map_fill}}(currChild, value); | 431 CSSToStyleMap::{{map_fill}}(state, currChild, value); |
432 currChild = currChild->next(); | 432 currChild = currChild->next(); |
433 } | 433 } |
434 while (currChild) { | 434 while (currChild) { |
435 /* Reset all remaining layers to not have the property set. */ | 435 /* Reset all remaining layers to not have the property set. */ |
436 currChild->clear{{fill_type}}(); | 436 currChild->clear{{fill_type}}(); |
437 currChild = currChild->next(); | 437 currChild = currChild->next(); |
438 } | 438 } |
439 } | 439 } |
440 {% endmacro %} | 440 {% endmacro %} |
441 {{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}} | 441 {{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}} |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 } | 582 } |
583 {{set_value(property)}}(ptype, c, url, | 583 {{set_value(property)}}(ptype, c, url, |
584 state.applyPropertyToRegularStyle(), | 584 state.applyPropertyToRegularStyle(), |
585 state.applyPropertyToVisitedLinkStyle()); | 585 state.applyPropertyToVisitedLinkStyle()); |
586 } | 586 } |
587 } | 587 } |
588 {% endmacro %} | 588 {% endmacro %} |
589 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 589 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
590 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 590 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
591 } // namespace blink | 591 } // namespace blink |
OLD | NEW |