OLD | NEW |
1 {% from "macros.tmpl" import lower_first -%} | 1 {% from "macros.tmpl" import lower_first -%} |
2 | 2 |
3 {# | 3 {# |
4 This file is for property handlers which use the templating engine to | 4 This file is for property handlers which use the templating engine to |
5 reduce (handwritten) code duplication. | 5 reduce (handwritten) code duplication. |
6 | 6 |
7 The `properties' dict can be used to access a property's parameters in | 7 The `properties' dict can be used to access a property's parameters in |
8 jinja2 templates (i.e. setter, getter, initial, type_name) | 8 jinja2 templates (i.e. setter, getter, initial, type_name) |
9 -#} | 9 -#} |
10 | 10 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 {{ declare_initial_function(property_id) }} { } | 285 {{ declare_initial_function(property_id) }} { } |
286 | 286 |
287 {{ declare_inherit_function(property_id) }} | 287 {{ declare_inherit_function(property_id) }} |
288 { | 288 { |
289 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); | 289 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); |
290 CounterDirectiveMap& parentMap = state.parentStyle()->accessCounterDirective
s(); | 290 CounterDirectiveMap& parentMap = state.parentStyle()->accessCounterDirective
s(); |
291 | 291 |
292 typedef CounterDirectiveMap::iterator Iterator; | 292 typedef CounterDirectiveMap::iterator Iterator; |
293 Iterator end = parentMap.end(); | 293 Iterator end = parentMap.end(); |
294 for (Iterator it = parentMap.begin(); it != end; ++it) { | 294 for (Iterator it = parentMap.begin(); it != end; ++it) { |
295 CounterDirectives& directives = map.add(it->key, CounterDirectives()).it
erator->value; | 295 CounterDirectives& directives = map.add(it->key, CounterDirectives()).st
oredValue->value; |
296 directives.inherit{{action}}(it->value); | 296 directives.inherit{{action}}(it->value); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 {{ declare_value_function(property_id) }} | 300 {{ declare_value_function(property_id) }} |
301 { | 301 { |
302 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); | 302 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); |
303 typedef CounterDirectiveMap::iterator Iterator; | 303 typedef CounterDirectiveMap::iterator Iterator; |
304 | 304 |
305 Iterator end = map.end(); | 305 Iterator end = map.end(); |
(...skipping 12 matching lines...) Expand all Loading... |
318 CSSValue* currValue = list->itemWithoutBoundsCheck(i); | 318 CSSValue* currValue = list->itemWithoutBoundsCheck(i); |
319 if (!currValue->isPrimitiveValue()) | 319 if (!currValue->isPrimitiveValue()) |
320 continue; | 320 continue; |
321 | 321 |
322 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); | 322 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); |
323 if (!pair || !pair->first() || !pair->second()) | 323 if (!pair || !pair->first() || !pair->second()) |
324 continue; | 324 continue; |
325 | 325 |
326 AtomicString identifier(pair->first()->getStringValue()); | 326 AtomicString identifier(pair->first()->getStringValue()); |
327 int value = pair->second()->getIntValue(); | 327 int value = pair->second()->getIntValue(); |
328 CounterDirectives& directives = map.add(identifier, CounterDirectives())
.iterator->value; | 328 CounterDirectives& directives = map.add(identifier, CounterDirectives())
.storedValue->value; |
329 {%- if action == "Reset" %} | 329 {%- if action == "Reset" %} |
330 directives.setResetValue(value); | 330 directives.setResetValue(value); |
331 {%- else %} | 331 {%- else %} |
332 directives.addIncrementValue(value); | 332 directives.addIncrementValue(value); |
333 {%- endif %} | 333 {%- endif %} |
334 } | 334 } |
335 } | 335 } |
336 {%- endmacro %} | 336 {%- endmacro %} |
337 | 337 |
338 {{ apply_counter("CSSPropertyCounterIncrement", "Increment") }} | 338 {{ apply_counter("CSSPropertyCounterIncrement", "Increment") }} |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 } else if (value->isImageValue() || value->isImageSetValue()) { | 494 } else if (value->isImageValue() || value->isImageSetValue()) { |
495 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); | 495 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); |
496 } | 496 } |
497 } | 497 } |
498 {%- endmacro %} | 498 {%- endmacro %} |
499 | 499 |
500 {{ apply_value_shape("CSSPropertyShapeInside") }} | 500 {{ apply_value_shape("CSSPropertyShapeInside") }} |
501 {{ apply_value_shape("CSSPropertyShapeOutside") }} | 501 {{ apply_value_shape("CSSPropertyShapeOutside") }} |
502 | 502 |
503 } // namespace WebCore | 503 } // namespace WebCore |
OLD | NEW |