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" |
11 | 11 |
12 #include "CSSValueKeywords.h" | 12 #include "CSSValueKeywords.h" |
13 #include "core/css/BasicShapeFunctions.h" | 13 #include "core/css/BasicShapeFunctions.h" |
14 #include "core/css/CSSContentDistributionValue.h" | 14 #include "core/css/CSSContentDistributionValue.h" |
15 #include "core/css/CSSPrimitiveValueMappings.h" | 15 #include "core/css/CSSPrimitiveValueMappings.h" |
16 #include "core/css/CSSStringValueBase.h" | 16 #include "core/css/CSSStringValues.h" |
17 #include "core/css/CSSValuePair.h" | 17 #include "core/css/CSSValuePair.h" |
18 #include "core/css/resolver/StyleResolverState.h" | 18 #include "core/css/resolver/StyleResolverState.h" |
19 | 19 |
20 {% macro declare_initial_function(property_id) %} | 20 {% macro declare_initial_function(property_id) %} |
21 void StyleBuilderFunctions::applyInitial{{property_id}}(StyleResolverState& stat
e) | 21 void StyleBuilderFunctions::applyInitial{{property_id}}(StyleResolverState& stat
e) |
22 {%- endmacro %} | 22 {%- endmacro %} |
23 {% macro declare_inherit_function(property_id) %} | 23 {% macro declare_inherit_function(property_id) %} |
24 void StyleBuilderFunctions::applyInherit{{property_id}}(StyleResolverState& stat
e) | 24 void StyleBuilderFunctions::applyInherit{{property_id}}(StyleResolverState& stat
e) |
25 {%- endmacro %} | 25 {%- endmacro %} |
26 {% macro declare_value_function(property_id) %} | 26 {% macro declare_value_function(property_id) %} |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 return; | 341 return; |
342 } | 342 } |
343 | 343 |
344 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); | 344 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); |
345 | 345 |
346 CSSValueList* list = toCSSValueList(value); | 346 CSSValueList* list = toCSSValueList(value); |
347 | 347 |
348 int length = list ? list->length() : 0; | 348 int length = list ? list->length() : 0; |
349 for (int i = 0; i < length; ++i) { | 349 for (int i = 0; i < length; ++i) { |
350 const CSSValuePair* pair = toCSSValuePair(list->item(i)); | 350 const CSSValuePair* pair = toCSSValuePair(list->item(i)); |
351 AtomicString identifier(toCSSCustomIdentValue(pair->first()).value()); | 351 AtomicString identifier(toCSSCustomIdentValue(pair->first()).string()); |
352 int value = toCSSPrimitiveValue(pair->second()).getIntValue(); | 352 int value = toCSSPrimitiveValue(pair->second()).getIntValue(); |
353 CounterDirectives& directives = map.add(identifier, CounterDirectives())
.storedValue->value; | 353 CounterDirectives& directives = map.add(identifier, CounterDirectives())
.storedValue->value; |
354 {% if action == 'Reset' %} | 354 {% if action == 'Reset' %} |
355 directives.setResetValue(value); | 355 directives.setResetValue(value); |
356 {% else %} | 356 {% else %} |
357 directives.addIncrementValue(value); | 357 directives.addIncrementValue(value); |
358 {% endif %} | 358 {% endif %} |
359 } | 359 } |
360 ASSERT(!map.isEmpty()); | 360 ASSERT(!map.isEmpty()); |
361 } | 361 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 527 } |
528 } | 528 } |
529 {{set_value(property)}}(paintType, color, url, | 529 {{set_value(property)}}(paintType, color, url, |
530 state.applyPropertyToRegularStyle(), | 530 state.applyPropertyToRegularStyle(), |
531 state.applyPropertyToVisitedLinkStyle()); | 531 state.applyPropertyToVisitedLinkStyle()); |
532 } | 532 } |
533 {% endmacro %} | 533 {% endmacro %} |
534 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 534 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
535 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 535 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
536 } // namespace blink | 536 } // namespace blink |
OLD | NEW |