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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 typedef CounterDirectiveMap::iterator Iterator; | 305 typedef CounterDirectiveMap::iterator Iterator; |
306 Iterator end = parentMap.end(); | 306 Iterator end = parentMap.end(); |
307 for (Iterator it = parentMap.begin(); it != end; ++it) { | 307 for (Iterator it = parentMap.begin(); it != end; ++it) { |
308 CounterDirectives& directives = map.add(it->key, CounterDirectives()).it erator->value; | 308 CounterDirectives& directives = map.add(it->key, CounterDirectives()).it erator->value; |
309 directives.inherit{{action}}(it->value); | 309 directives.inherit{{action}}(it->value); |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 {{ declare_value_function(property_id) }} | 313 {{ declare_value_function(property_id) }} |
314 { | 314 { |
315 if (!value->isValueList()) | |
316 return; | |
317 | |
318 CSSValueList* list = toCSSValueList(value); | |
319 | |
320 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); | 315 CounterDirectiveMap& map = state.style()->accessCounterDirectives(); |
321 typedef CounterDirectiveMap::iterator Iterator; | 316 typedef CounterDirectiveMap::iterator Iterator; |
322 | 317 |
323 Iterator end = map.end(); | 318 Iterator end = map.end(); |
324 for (Iterator it = map.begin(); it != end; ++it) | 319 for (Iterator it = map.begin(); it != end; ++it) |
325 it->value.clear{{action}}(); | 320 it->value.clear{{action}}(); |
326 | 321 |
322 if (!value->isValueList()) | |
323 return; | |
Timothy Loh
2014/01/22 23:55:20
Maybe worthwhile to ASSERT(toCSSPrimitiveValue(val
| |
324 | |
325 CSSValueList* list = toCSSValueList(value); | |
326 | |
327 int length = list ? list->length() : 0; | 327 int length = list ? list->length() : 0; |
328 for (int i = 0; i < length; ++i) { | 328 for (int i = 0; i < length; ++i) { |
329 CSSValue* currValue = list->itemWithoutBoundsCheck(i); | 329 CSSValue* currValue = list->itemWithoutBoundsCheck(i); |
330 if (!currValue->isPrimitiveValue()) | 330 if (!currValue->isPrimitiveValue()) |
331 continue; | 331 continue; |
332 | 332 |
333 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); | 333 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); |
334 if (!pair || !pair->first() || !pair->second()) | 334 if (!pair || !pair->first() || !pair->second()) |
335 continue; | 335 continue; |
336 | 336 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
505 } else if (value->isImageValue()) { | 505 } else if (value->isImageValue()) { |
506 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage( {{property_id}}, value))); | 506 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage( {{property_id}}, value))); |
507 } | 507 } |
508 } | 508 } |
509 {%- endmacro %} | 509 {%- endmacro %} |
510 | 510 |
511 {{ apply_value_shape("CSSPropertyShapeInside") }} | 511 {{ apply_value_shape("CSSPropertyShapeInside") }} |
512 {{ apply_value_shape("CSSPropertyShapeOutside") }} | 512 {{ apply_value_shape("CSSPropertyShapeOutside") }} |
513 | 513 |
514 } // namespace WebCore | 514 } // namespace WebCore |
OLD | NEW |