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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 | 473 |
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) }}(0); | 483 {{ set_value(property) }}(nullptr); |
484 else if (primitiveValue->getValueID() == CSSValueMarginBox | 484 else if (primitiveValue->getValueID() == CSSValueMarginBox |
485 || primitiveValue->getValueID() == CSSValueBorderBox | 485 || primitiveValue->getValueID() == CSSValueBorderBox |
486 || primitiveValue->getValueID() == CSSValuePaddingBox | 486 || primitiveValue->getValueID() == CSSValuePaddingBox |
487 || primitiveValue->getValueID() == CSSValueContentBox) | 487 || primitiveValue->getValueID() == CSSValueContentBox) |
488 {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(LayoutBox
(*primitiveValue))); | 488 {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(LayoutBox
(*primitiveValue))); |
489 else if (primitiveValue->getValueID() == CSSValueOutsideShape) | 489 else if (primitiveValue->getValueID() == CSSValueOutsideShape) |
490 {{ set_value(property) }}(ShapeValue::createOutsideValue()); | 490 {{ set_value(property) }}(ShapeValue::createOutsideValue()); |
491 else if (primitiveValue->isShape()) { | 491 else if (primitiveValue->isShape()) { |
492 {{ set_value(property) }}(ShapeValue::createShapeValue(basicShapeFor
Value(state, primitiveValue->getShapeValue()))); | 492 {{ set_value(property) }}(ShapeValue::createShapeValue(basicShapeFor
Value(state, primitiveValue->getShapeValue()))); |
493 } | 493 } |
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 |