| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 {% elif modifier_type == 'Width' %} | 248 {% elif modifier_type == 'Width' %} |
| 249 image.setBorderSlices(state.styleMap().mapNinePieceImageQuad(value)); | 249 image.setBorderSlices(state.styleMap().mapNinePieceImageQuad(value)); |
| 250 {% endif %} | 250 {% endif %} |
| 251 state.style()->{{setter}}(image); | 251 state.style()->{{setter}}(image); |
| 252 } | 252 } |
| 253 {% endmacro %} | 253 {% endmacro %} |
| 254 {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}} | 254 {{apply_border_image_modifier('CSSPropertyBorderImageOutset', 'Outset')}} |
| 255 {{apply_border_image_modifier('CSSPropertyBorderImageRepeat', 'Repeat')}} | 255 {{apply_border_image_modifier('CSSPropertyBorderImageRepeat', 'Repeat')}} |
| 256 {{apply_border_image_modifier('CSSPropertyBorderImageSlice', 'Slice')}} | 256 {{apply_border_image_modifier('CSSPropertyBorderImageSlice', 'Slice')}} |
| 257 {{apply_border_image_modifier('CSSPropertyBorderImageWidth', 'Width')}} | 257 {{apply_border_image_modifier('CSSPropertyBorderImageWidth', 'Width')}} |
| 258 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageOutset', 'Outset')}} | |
| 259 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageRepeat', 'Repeat')}} | |
| 260 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageSlice', 'Slice')}} | |
| 261 {{apply_border_image_modifier('CSSPropertyWebkitMaskBoxImageWidth', 'Width')}} | |
| 262 | 258 |
| 263 {% macro apply_value_border_image_source(property_id) %} | 259 {% macro apply_value_border_image_source(property_id) %} |
| 264 {{declare_value_function(property_id)}} | 260 {{declare_value_function(property_id)}} |
| 265 { | 261 { |
| 266 {% set property = properties[property_id] %} | 262 {% set property = properties[property_id] %} |
| 267 {{set_value(property)}}(state.styleImage({{property_id}}, value)); | 263 {{set_value(property)}}(state.styleImage({{property_id}}, value)); |
| 268 } | 264 } |
| 269 {% endmacro %} | 265 {% endmacro %} |
| 270 {{apply_value_border_image_source('CSSPropertyBorderImageSource')}} | 266 {{apply_value_border_image_source('CSSPropertyBorderImageSource')}} |
| 271 {{apply_value_border_image_source('CSSPropertyWebkitMaskBoxImageSource')}} | |
| 272 | 267 |
| 273 {% macro apply_color(property_id, initial_color='StyleColor::currentColor') %} | 268 {% macro apply_color(property_id, initial_color='StyleColor::currentColor') %} |
| 274 {% set property = properties[property_id] %} | 269 {% set property = properties[property_id] %} |
| 275 {{declare_initial_function(property_id)}} | 270 {{declare_initial_function(property_id)}} |
| 276 { | 271 { |
| 277 StyleColor color = {{initial_color}}(); | 272 StyleColor color = {{initial_color}}(); |
| 278 {{set_value(property)}}(color); | 273 {{set_value(property)}}(color); |
| 279 } | 274 } |
| 280 | 275 |
| 281 {{declare_inherit_function(property_id)}} | 276 {{declare_inherit_function(property_id)}} |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 {% endmacro %} | 412 {% endmacro %} |
| 418 {{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}} | 413 {{apply_fill_layer('CSSPropertyBackgroundAttachment', 'Attachment')}} |
| 419 {{apply_fill_layer('CSSPropertyBackgroundClip', 'Clip')}} | 414 {{apply_fill_layer('CSSPropertyBackgroundClip', 'Clip')}} |
| 420 {{apply_fill_layer('CSSPropertyBackgroundImage', 'Image')}} | 415 {{apply_fill_layer('CSSPropertyBackgroundImage', 'Image')}} |
| 421 {{apply_fill_layer('CSSPropertyBackgroundOrigin', 'Origin')}} | 416 {{apply_fill_layer('CSSPropertyBackgroundOrigin', 'Origin')}} |
| 422 {{apply_fill_layer('CSSPropertyBackgroundPositionX', 'XPosition')}} | 417 {{apply_fill_layer('CSSPropertyBackgroundPositionX', 'XPosition')}} |
| 423 {{apply_fill_layer('CSSPropertyBackgroundPositionY', 'YPosition')}} | 418 {{apply_fill_layer('CSSPropertyBackgroundPositionY', 'YPosition')}} |
| 424 {{apply_fill_layer('CSSPropertyBackgroundRepeatX', 'RepeatX')}} | 419 {{apply_fill_layer('CSSPropertyBackgroundRepeatX', 'RepeatX')}} |
| 425 {{apply_fill_layer('CSSPropertyBackgroundRepeatY', 'RepeatY')}} | 420 {{apply_fill_layer('CSSPropertyBackgroundRepeatY', 'RepeatY')}} |
| 426 {{apply_fill_layer('CSSPropertyBackgroundSize', 'Size')}} | 421 {{apply_fill_layer('CSSPropertyBackgroundSize', 'Size')}} |
| 427 {{apply_fill_layer('CSSPropertyMaskSourceType', 'MaskSourceType')}} | |
| 428 {{apply_fill_layer('CSSPropertyWebkitBackgroundComposite', 'Composite')}} | 422 {{apply_fill_layer('CSSPropertyWebkitBackgroundComposite', 'Composite')}} |
| 429 {{apply_fill_layer('CSSPropertyWebkitMaskClip', 'Clip')}} | |
| 430 {{apply_fill_layer('CSSPropertyWebkitMaskComposite', 'Composite')}} | |
| 431 {{apply_fill_layer('CSSPropertyWebkitMaskImage', 'Image')}} | |
| 432 {{apply_fill_layer('CSSPropertyWebkitMaskOrigin', 'Origin')}} | |
| 433 {{apply_fill_layer('CSSPropertyWebkitMaskPositionX', 'XPosition')}} | |
| 434 {{apply_fill_layer('CSSPropertyWebkitMaskPositionY', 'YPosition')}} | |
| 435 {{apply_fill_layer('CSSPropertyWebkitMaskRepeatX', 'RepeatX')}} | |
| 436 {{apply_fill_layer('CSSPropertyWebkitMaskRepeatY', 'RepeatY')}} | |
| 437 {{apply_fill_layer('CSSPropertyWebkitMaskSize', 'Size')}} | |
| 438 | 423 |
| 439 {% macro apply_value_number(property_id, id_for_minus_one) %} | 424 {% macro apply_value_number(property_id, id_for_minus_one) %} |
| 440 {{declare_value_function(property_id)}} | 425 {{declare_value_function(property_id)}} |
| 441 { | 426 { |
| 442 {% set property = properties[property_id] %} | 427 {% set property = properties[property_id] %} |
| 443 if (!value->isPrimitiveValue()) | 428 if (!value->isPrimitiveValue()) |
| 444 return; | 429 return; |
| 445 | 430 |
| 446 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 431 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 447 if (primitiveValue->getValueID() == {{id_for_minus_one}}) | 432 if (primitiveValue->getValueID() == {{id_for_minus_one}}) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 473 state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second
()); | 458 state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->second
()); |
| 474 } else { | 459 } else { |
| 475 state.style()->set{{alignment_type}}(*primitiveValue); | 460 state.style()->set{{alignment_type}}(*primitiveValue); |
| 476 } | 461 } |
| 477 } | 462 } |
| 478 {% endmacro %} | 463 {% endmacro %} |
| 479 {{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} | 464 {{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} |
| 480 {{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} | 465 {{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} |
| 481 | 466 |
| 482 } // namespace blink | 467 } // namespace blink |
| OLD | NEW |