| 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 "StyleBuilderFunctions.h" | 9 #include "StyleBuilderFunctions.h" |
| 10 | 10 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 const CounterDirectiveMap* parentMap = state.parentStyle()->counterDirectives(
); | 330 const CounterDirectiveMap* parentMap = state.parentStyle()->counterDirectives(
); |
| 331 if (!parentMap) | 331 if (!parentMap) |
| 332 return; | 332 return; |
| 333 | 333 |
| 334 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); | 334 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); |
| 335 DCHECK(!parentMap->isEmpty()); | 335 DCHECK(!parentMap->isEmpty()); |
| 336 | 336 |
| 337 typedef CounterDirectiveMap::const_iterator Iterator; | 337 typedef CounterDirectiveMap::const_iterator Iterator; |
| 338 Iterator end = parentMap->end(); | 338 Iterator end = parentMap->end(); |
| 339 for (Iterator it = parentMap->begin(); it != end; ++it) { | 339 for (Iterator it = parentMap->begin(); it != end; ++it) { |
| 340 CounterDirectives& directives = map.add(it->key, CounterDirectives()).stored
Value->value; | 340 CounterDirectives& directives = map.insert(it->key, CounterDirectives()).sto
redValue->value; |
| 341 directives.inherit{{action}}(it->value); | 341 directives.inherit{{action}}(it->value); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 {{declare_value_function(property_id)}} { | 345 {{declare_value_function(property_id)}} { |
| 346 state.style()->clear{{action}}Directives(); | 346 state.style()->clear{{action}}Directives(); |
| 347 | 347 |
| 348 if (!value.isValueList()) { | 348 if (!value.isValueList()) { |
| 349 DCHECK(value.isIdentifierValue()); | 349 DCHECK(value.isIdentifierValue()); |
| 350 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone); | 350 DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone); |
| 351 return; | 351 return; |
| 352 } | 352 } |
| 353 | 353 |
| 354 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); | 354 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); |
| 355 | 355 |
| 356 const CSSValueList& list = toCSSValueList(value); | 356 const CSSValueList& list = toCSSValueList(value); |
| 357 | 357 |
| 358 for (size_t i = 0; i < list.length(); ++i) { | 358 for (size_t i = 0; i < list.length(); ++i) { |
| 359 const CSSValuePair& pair = toCSSValuePair(list.item(i)); | 359 const CSSValuePair& pair = toCSSValuePair(list.item(i)); |
| 360 AtomicString identifier(toCSSCustomIdentValue(pair.first()).value()); | 360 AtomicString identifier(toCSSCustomIdentValue(pair.first()).value()); |
| 361 int value = toCSSPrimitiveValue(pair.second()).getIntValue(); | 361 int value = toCSSPrimitiveValue(pair.second()).getIntValue(); |
| 362 CounterDirectives& directives = | 362 CounterDirectives& directives = |
| 363 map.add(identifier, CounterDirectives()).storedValue->value; | 363 map.insert(identifier, CounterDirectives()).storedValue->value; |
| 364 {% if action == 'Reset' %} | 364 {% if action == 'Reset' %} |
| 365 directives.setResetValue(value); | 365 directives.setResetValue(value); |
| 366 {% else %} | 366 {% else %} |
| 367 directives.addIncrementValue(value); | 367 directives.addIncrementValue(value); |
| 368 {% endif %} | 368 {% endif %} |
| 369 } | 369 } |
| 370 DCHECK(!map.isEmpty()); | 370 DCHECK(!map.isEmpty()); |
| 371 } | 371 } |
| 372 {% endmacro %} | 372 {% endmacro %} |
| 373 {{apply_counter('CSSPropertyCounterIncrement', 'Increment')}} | 373 {{apply_counter('CSSPropertyCounterIncrement', 'Increment')}} |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 : SVG_PAINTTYPE_URI_RGBCOLOR; | 548 : SVG_PAINTTYPE_URI_RGBCOLOR; |
| 549 } | 549 } |
| 550 {{set_value(property)}}(paintType, color, url, | 550 {{set_value(property)}}(paintType, color, url, |
| 551 state.applyPropertyToRegularStyle(), | 551 state.applyPropertyToRegularStyle(), |
| 552 state.applyPropertyToVisitedLinkStyle()); | 552 state.applyPropertyToVisitedLinkStyle()); |
| 553 } | 553 } |
| 554 {% endmacro %} | 554 {% endmacro %} |
| 555 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 555 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
| 556 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 556 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
| 557 } // namespace blink | 557 } // namespace blink |
| OLD | NEW |