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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 {{ apply_value_number("CSSPropertyInternalMarqueeRepetition", "CSSValueInfinite"
) }} | 474 {{ apply_value_number("CSSPropertyInternalMarqueeRepetition", "CSSValueInfinite"
) }} |
475 | 475 |
476 {%- macro apply_value_shape(property_id) %} | 476 {%- macro apply_value_shape(property_id) %} |
477 {{ declare_value_function(property_id) }} | 477 {{ declare_value_function(property_id) }} |
478 { | 478 { |
479 {%- set property = properties[property_id] %} | 479 {%- set property = properties[property_id] %} |
480 if (value->isPrimitiveValue()) { | 480 if (value->isPrimitiveValue()) { |
481 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 481 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
482 if (primitiveValue->getValueID() == CSSValueAuto) | 482 if (primitiveValue->getValueID() == CSSValueAuto) |
483 {{ set_value(property) }}(nullptr); | 483 {{ set_value(property) }}(nullptr); |
484 else if (primitiveValue->getValueID() == CSSValueMarginBox | |
485 || primitiveValue->getValueID() == CSSValueBorderBox | |
486 || primitiveValue->getValueID() == CSSValuePaddingBox | |
487 || primitiveValue->getValueID() == CSSValueContentBox) | |
488 {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(LayoutBox
(*primitiveValue))); | |
489 else if (primitiveValue->getValueID() == CSSValueOutsideShape) | 484 else if (primitiveValue->getValueID() == CSSValueOutsideShape) |
490 {{ set_value(property) }}(ShapeValue::createOutsideValue()); | 485 {{ set_value(property) }}(ShapeValue::createOutsideValue()); |
491 else if (primitiveValue->isShape()) { | |
492 {{ set_value(property) }}(ShapeValue::createShapeValue(basicShapeFor
Value(state, primitiveValue->getShapeValue()))); | |
493 } | |
494 } else if (value->isImageValue() || value->isImageSetValue()) { | 486 } else if (value->isImageValue() || value->isImageSetValue()) { |
495 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); | 487 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); |
| 488 } else if (value->isValueList()) { |
| 489 RefPtr<BasicShape> shape; |
| 490 LayoutBox layoutBox = BoxMissing; |
| 491 CSSValueList* valueList = toCSSValueList(value); |
| 492 for (unsigned i = 0; i < valueList->length(); ++i) { |
| 493 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->i
temWithoutBoundsCheck(i)); |
| 494 if (primitiveValue->isShape()) |
| 495 shape = basicShapeForValue(state, primitiveValue->getShapeValue(
)); |
| 496 else if (primitiveValue->getValueID() == CSSValueContentBox |
| 497 || primitiveValue->getValueID() == CSSValueBorderBox |
| 498 || primitiveValue->getValueID() == CSSValuePaddingBox |
| 499 || primitiveValue->getValueID() == CSSValueMarginBox) |
| 500 layoutBox = LayoutBox(*primitiveValue); |
| 501 else |
| 502 return; |
| 503 } |
| 504 |
| 505 if (shape) |
| 506 {{ set_value(property) }}(ShapeValue::createShapeValue(shape.release
(), layoutBox)); |
| 507 else if (layoutBox != BoxMissing) |
| 508 {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(layoutBox
)); |
496 } | 509 } |
497 } | 510 } |
498 {%- endmacro %} | 511 {%- endmacro %} |
499 | 512 |
500 {{ apply_value_shape("CSSPropertyShapeInside") }} | 513 {{ apply_value_shape("CSSPropertyShapeInside") }} |
501 {{ apply_value_shape("CSSPropertyShapeOutside") }} | 514 {{ apply_value_shape("CSSPropertyShapeOutside") }} |
502 | 515 |
503 } // namespace WebCore | 516 } // namespace WebCore |
OLD | NEW |