| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return; | 143 return; |
| 144 | 144 |
| 145 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 145 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 146 if (primitiveValue->getValueID() == {{auto_identity}}) | 146 if (primitiveValue->getValueID() == {{auto_identity}}) |
| 147 state.style()->{{auto_setter}}(); | 147 state.style()->{{auto_setter}}(); |
| 148 else | 148 else |
| 149 {{convert_and_set_value(property)}} | 149 {{convert_and_set_value(property)}} |
| 150 } | 150 } |
| 151 {% endmacro %} | 151 {% endmacro %} |
| 152 {{apply_auto('CSSPropertyClip')}} | 152 {{apply_auto('CSSPropertyClip')}} |
| 153 {{apply_auto('CSSPropertyColumnCount')}} |
| 154 {{apply_auto('CSSPropertyColumnGap', auto_getter='hasNormalColumnGap', auto_sett
er='setHasNormalColumnGap', auto_identity='CSSValueNormal')}} |
| 155 {{apply_auto('CSSPropertyColumnWidth')}} |
| 153 {{apply_auto('CSSPropertyOrphans')}} | 156 {{apply_auto('CSSPropertyOrphans')}} |
| 154 {{apply_auto('CSSPropertyWebkitColumnCount')}} | |
| 155 {{apply_auto('CSSPropertyWebkitColumnGap', auto_getter='hasNormalColumnGap', aut
o_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal')}} | |
| 156 {{apply_auto('CSSPropertyWebkitColumnWidth')}} | |
| 157 {{apply_auto('CSSPropertyWidows')}} | 157 {{apply_auto('CSSPropertyWidows')}} |
| 158 {{apply_auto('CSSPropertyZIndex')}} | 158 {{apply_auto('CSSPropertyZIndex')}} |
| 159 | 159 |
| 160 static bool lengthTypeAndValueMatch(const Length& length, LengthType type, float
value) | 160 static bool lengthTypeAndValueMatch(const Length& length, LengthType type, float
value) |
| 161 { | 161 { |
| 162 return length.type() == type && length.value() == value; | 162 return length.type() == type && length.value() == value; |
| 163 } | 163 } |
| 164 | 164 |
| 165 static bool lengthTypeAndValueMatch(const LengthBox& lengthBox, LengthType type,
float value) | 165 static bool lengthTypeAndValueMatch(const LengthBox& lengthBox, LengthType type,
float value) |
| 166 { | 166 { |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 {{set_value(property)}}(StyleBuilderConverter::convertStyleColor(state,
value)); | 308 {{set_value(property)}}(StyleBuilderConverter::convertStyleColor(state,
value)); |
| 309 if (state.applyPropertyToVisitedLinkStyle()) | 309 if (state.applyPropertyToVisitedLinkStyle()) |
| 310 state.style()->{{visited_link_setter}}(StyleBuilderConverter::convertSty
leColor(state, value, true)); | 310 state.style()->{{visited_link_setter}}(StyleBuilderConverter::convertSty
leColor(state, value, true)); |
| 311 } | 311 } |
| 312 {% endmacro %} | 312 {% endmacro %} |
| 313 {{apply_color('CSSPropertyBackgroundColor', initial_color='ComputedStyle::initia
lBackgroundColor') }} | 313 {{apply_color('CSSPropertyBackgroundColor', initial_color='ComputedStyle::initia
lBackgroundColor') }} |
| 314 {{apply_color('CSSPropertyBorderBottomColor')}} | 314 {{apply_color('CSSPropertyBorderBottomColor')}} |
| 315 {{apply_color('CSSPropertyBorderLeftColor')}} | 315 {{apply_color('CSSPropertyBorderLeftColor')}} |
| 316 {{apply_color('CSSPropertyBorderRightColor')}} | 316 {{apply_color('CSSPropertyBorderRightColor')}} |
| 317 {{apply_color('CSSPropertyBorderTopColor')}} | 317 {{apply_color('CSSPropertyBorderTopColor')}} |
| 318 {{apply_color('CSSPropertyColumnRuleColor')}} |
| 318 {{apply_color('CSSPropertyOutlineColor')}} | 319 {{apply_color('CSSPropertyOutlineColor')}} |
| 319 {{apply_color('CSSPropertyTextDecorationColor')}} | 320 {{apply_color('CSSPropertyTextDecorationColor')}} |
| 320 {{apply_color('CSSPropertyWebkitColumnRuleColor')}} | |
| 321 {{apply_color('CSSPropertyWebkitTextEmphasisColor')}} | 321 {{apply_color('CSSPropertyWebkitTextEmphasisColor')}} |
| 322 {{apply_color('CSSPropertyWebkitTextFillColor')}} | 322 {{apply_color('CSSPropertyWebkitTextFillColor')}} |
| 323 {{apply_color('CSSPropertyWebkitTextStrokeColor')}} | 323 {{apply_color('CSSPropertyWebkitTextStrokeColor')}} |
| 324 | 324 |
| 325 {% macro apply_counter(property_id, action) %} | 325 {% macro apply_counter(property_id, action) %} |
| 326 {% set property = properties[property_id] %} | 326 {% set property = properties[property_id] %} |
| 327 {{declare_initial_function(property_id)}} { | 327 {{declare_initial_function(property_id)}} { |
| 328 state.style()->clear{{action}}Directives(); | 328 state.style()->clear{{action}}Directives(); |
| 329 } | 329 } |
| 330 | 330 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 } | 557 } |
| 558 {{set_value(property)}}(ptype, c, url, | 558 {{set_value(property)}}(ptype, c, url, |
| 559 state.applyPropertyToRegularStyle(), | 559 state.applyPropertyToRegularStyle(), |
| 560 state.applyPropertyToVisitedLinkStyle()); | 560 state.applyPropertyToVisitedLinkStyle()); |
| 561 } | 561 } |
| 562 } | 562 } |
| 563 {% endmacro %} | 563 {% endmacro %} |
| 564 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 564 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
| 565 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 565 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
| 566 } // namespace blink | 566 } // namespace blink |
| OLD | NEW |