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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 if (value->isPrimitiveValue()) { | 450 if (value->isPrimitiveValue()) { |
451 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 451 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
452 if (primitiveValue->getValueID() == CSSValueAuto) | 452 if (primitiveValue->getValueID() == CSSValueAuto) |
453 {{ set_value(property) }}(nullptr); | 453 {{ set_value(property) }}(nullptr); |
454 else if (primitiveValue->getValueID() == CSSValueOutsideShape) | 454 else if (primitiveValue->getValueID() == CSSValueOutsideShape) |
455 {{ set_value(property) }}(ShapeValue::createOutsideValue()); | 455 {{ set_value(property) }}(ShapeValue::createOutsideValue()); |
456 } else if (value->isImageValue() || value->isImageSetValue()) { | 456 } else if (value->isImageValue() || value->isImageSetValue()) { |
457 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); | 457 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage(
{{property_id}}, value))); |
458 } else if (value->isValueList()) { | 458 } else if (value->isValueList()) { |
459 RefPtr<BasicShape> shape; | 459 RefPtr<BasicShape> shape; |
460 LayoutBox layoutBox = BoxMissing; | 460 CSSBoxType cssBox = BoxMissing; |
461 CSSValueList* valueList = toCSSValueList(value); | 461 CSSValueList* valueList = toCSSValueList(value); |
462 for (unsigned i = 0; i < valueList->length(); ++i) { | 462 for (unsigned i = 0; i < valueList->length(); ++i) { |
463 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->i
temWithoutBoundsCheck(i)); | 463 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(valueList->i
temWithoutBoundsCheck(i)); |
464 if (primitiveValue->isShape()) | 464 if (primitiveValue->isShape()) |
465 shape = basicShapeForValue(state, primitiveValue->getShapeValue(
)); | 465 shape = basicShapeForValue(state, primitiveValue->getShapeValue(
)); |
466 else if (primitiveValue->getValueID() == CSSValueContentBox | 466 else if (primitiveValue->getValueID() == CSSValueContentBox |
467 || primitiveValue->getValueID() == CSSValueBorderBox | 467 || primitiveValue->getValueID() == CSSValueBorderBox |
468 || primitiveValue->getValueID() == CSSValuePaddingBox | 468 || primitiveValue->getValueID() == CSSValuePaddingBox |
469 || primitiveValue->getValueID() == CSSValueMarginBox) | 469 || primitiveValue->getValueID() == CSSValueMarginBox) |
470 layoutBox = LayoutBox(*primitiveValue); | 470 cssBox = CSSBoxType(*primitiveValue); |
471 else | 471 else |
472 return; | 472 return; |
473 } | 473 } |
474 | 474 |
475 if (shape) | 475 if (shape) |
476 {{ set_value(property) }}(ShapeValue::createShapeValue(shape.release
(), layoutBox)); | 476 {{ set_value(property) }}(ShapeValue::createShapeValue(shape.release
(), cssBox)); |
477 else if (layoutBox != BoxMissing) | 477 else if (cssBox != BoxMissing) |
478 {{ set_value(property) }}(ShapeValue::createLayoutBoxValue(layoutBox
)); | 478 {{ set_value(property) }}(ShapeValue::createBoxShapeValue(cssBox)); |
479 } | 479 } |
480 } | 480 } |
481 {%- endmacro %} | 481 {%- endmacro %} |
482 | 482 |
483 {{ apply_value_shape("CSSPropertyShapeOutside") }} | 483 {{ apply_value_shape("CSSPropertyShapeOutside") }} |
484 | 484 |
485 } // namespace WebCore | 485 } // namespace WebCore |
OLD | NEW |