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 ASSERT(value->isPrimitiveValue() && toCSSPrimitiveValue(value)->getValue
ID() == CSSValueNone); |
| 324 return; |
| 325 } |
| 326 |
| 327 CSSValueList* list = toCSSValueList(value); |
| 328 |
327 int length = list ? list->length() : 0; | 329 int length = list ? list->length() : 0; |
328 for (int i = 0; i < length; ++i) { | 330 for (int i = 0; i < length; ++i) { |
329 CSSValue* currValue = list->itemWithoutBoundsCheck(i); | 331 CSSValue* currValue = list->itemWithoutBoundsCheck(i); |
330 if (!currValue->isPrimitiveValue()) | 332 if (!currValue->isPrimitiveValue()) |
331 continue; | 333 continue; |
332 | 334 |
333 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); | 335 Pair* pair = toCSSPrimitiveValue(currValue)->getPairValue(); |
334 if (!pair || !pair->first() || !pair->second()) | 336 if (!pair || !pair->first() || !pair->second()) |
335 continue; | 337 continue; |
336 | 338 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } else if (value->isImageValue()) { | 507 } else if (value->isImageValue()) { |
506 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); | 508 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); |
507 } | 509 } |
508 } | 510 } |
509 {%- endmacro %} | 511 {%- endmacro %} |
510 | 512 |
511 {{ apply_value_shape("CSSPropertyShapeInside") }} | 513 {{ apply_value_shape("CSSPropertyShapeInside") }} |
512 {{ apply_value_shape("CSSPropertyShapeOutside") }} | 514 {{ apply_value_shape("CSSPropertyShapeOutside") }} |
513 | 515 |
514 } // namespace WebCore | 516 } // namespace WebCore |
OLD | NEW |