| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 {{declare_inherit_function(property_id)}} | 132 {{declare_inherit_function(property_id)}} |
| 133 { | 133 { |
| 134 if (state.parentStyle()->{{auto_getter}}()) | 134 if (state.parentStyle()->{{auto_getter}}()) |
| 135 state.style()->{{auto_setter}}(); | 135 state.style()->{{auto_setter}}(); |
| 136 else | 136 else |
| 137 {{set_value(property)}}(state.parentStyle()->{{property.getter}}()); | 137 {{set_value(property)}}(state.parentStyle()->{{property.getter}}()); |
| 138 } | 138 } |
| 139 | 139 |
| 140 {{declare_value_function(property_id)}} | 140 {{declare_value_function(property_id)}} |
| 141 { | 141 { |
| 142 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 142 if (value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValueID() ==
{{auto_identity}}) |
| 143 if (primitiveValue->getValueID() == {{auto_identity}}) | |
| 144 state.style()->{{auto_setter}}(); | 143 state.style()->{{auto_setter}}(); |
| 145 else | 144 else |
| 146 {{convert_and_set_value(property)}} | 145 {{convert_and_set_value(property)}} |
| 147 } | 146 } |
| 148 {% endmacro %} | 147 {% endmacro %} |
| 149 {{apply_auto('CSSPropertyClip')}} | 148 {{apply_auto('CSSPropertyClip')}} |
| 150 {{apply_auto('CSSPropertyOrphans')}} | 149 {{apply_auto('CSSPropertyOrphans')}} |
| 151 {{apply_auto('CSSPropertyWebkitColumnCount')}} | 150 {{apply_auto('CSSPropertyWebkitColumnCount')}} |
| 152 {{apply_auto('CSSPropertyWebkitColumnGap', auto_getter='hasNormalColumnGap', aut
o_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal')}} | 151 {{apply_auto('CSSPropertyWebkitColumnGap', auto_getter='hasNormalColumnGap', aut
o_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal')}} |
| 153 {{apply_auto('CSSPropertyWebkitColumnWidth')}} | 152 {{apply_auto('CSSPropertyWebkitColumnWidth')}} |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; | 525 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; |
| 527 } | 526 } |
| 528 {{set_value(property)}}(paintType, color, url, | 527 {{set_value(property)}}(paintType, color, url, |
| 529 state.applyPropertyToRegularStyle(), | 528 state.applyPropertyToRegularStyle(), |
| 530 state.applyPropertyToVisitedLinkStyle()); | 529 state.applyPropertyToVisitedLinkStyle()); |
| 531 } | 530 } |
| 532 {% endmacro %} | 531 {% endmacro %} |
| 533 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 532 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
| 534 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 533 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
| 535 } // namespace blink | 534 } // namespace blink |
| OLD | NEW |