| OLD | NEW |
| 1 {% from 'macros.tmpl' import license %} | 1 {% from 'macros.tmpl' import license %} |
| 2 {# | 2 {# |
| 3 This file is for property handlers which use the templating engine to | 3 This file is for property handlers which use the templating engine to |
| 4 reduce (handwritten) code duplication. | 4 reduce (handwritten) code duplication. |
| 5 | 5 |
| 6 The `properties' dict can be used to access a property's parameters in | 6 The `properties' dict can be used to access a property's parameters in |
| 7 jinja2 templates (i.e. setter, getter, initial, type_name) | 7 jinja2 templates (i.e. setter, getter, initial, type_name) |
| 8 #} | 8 #} |
| 9 #include "config.h" | 9 #include "config.h" |
| 10 #include "StyleBuilderFunctions.h" | 10 #include "StyleBuilderFunctions.h" |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 if (!namedGridAreas.isEmpty()) | 486 if (!namedGridAreas.isEmpty()) |
| 487 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGri
dAreas, namedGridLines, For{{type}}s); | 487 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGri
dAreas, namedGridLines, For{{type}}s); |
| 488 state.style()->setGridTemplate{{type}}s(trackSizes); | 488 state.style()->setGridTemplate{{type}}s(trackSizes); |
| 489 state.style()->setNamedGrid{{type}}Lines(namedGridLines); | 489 state.style()->setNamedGrid{{type}}Lines(namedGridLines); |
| 490 state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); | 490 state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); |
| 491 } | 491 } |
| 492 {% endmacro %} | 492 {% endmacro %} |
| 493 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} | 493 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} |
| 494 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} | 494 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} |
| 495 | 495 |
| 496 {% macro apply_value_number(property_id, id_for_minus_one) %} | |
| 497 {{declare_value_function(property_id)}} | |
| 498 { | |
| 499 {% set property = properties[property_id] %} | |
| 500 if (!value->isPrimitiveValue()) | |
| 501 return; | |
| 502 | |
| 503 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | |
| 504 if (primitiveValue->getValueID() == {{id_for_minus_one}}) | |
| 505 {{set_value(property)}}(-1); | |
| 506 else | |
| 507 {{set_value(property)}}(primitiveValue->getValue<{{property.type_name}}>
(CSSPrimitiveValue::CSS_NUMBER)); | |
| 508 } | |
| 509 {% endmacro %} | |
| 510 {{apply_value_number('CSSPropertyInternalMarqueeRepetition', 'CSSValueInfinite')
}} | |
| 511 | |
| 512 {% macro apply_alignment(property_id, alignment_type) %} | 496 {% macro apply_alignment(property_id, alignment_type) %} |
| 513 {% set property = properties[property_id] %} | 497 {% set property = properties[property_id] %} |
| 514 {{declare_initial_function(property_id)}} | 498 {{declare_initial_function(property_id)}} |
| 515 { | 499 { |
| 516 state.style()->set{{alignment_type}}(RenderStyle::initial{{alignment_type}}(
)); | 500 state.style()->set{{alignment_type}}(RenderStyle::initial{{alignment_type}}(
)); |
| 517 state.style()->set{{alignment_type}}OverflowAlignment(RenderStyle::initial{{
alignment_type}}OverflowAlignment()); | 501 state.style()->set{{alignment_type}}OverflowAlignment(RenderStyle::initial{{
alignment_type}}OverflowAlignment()); |
| 518 } | 502 } |
| 519 | 503 |
| 520 {{declare_inherit_function(property_id)}} | 504 {{declare_inherit_function(property_id)}} |
| 521 { | 505 { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 } | 582 } |
| 599 {{set_value(property)}}(ptype, c, url, | 583 {{set_value(property)}}(ptype, c, url, |
| 600 state.applyPropertyToRegularStyle(), | 584 state.applyPropertyToRegularStyle(), |
| 601 state.applyPropertyToVisitedLinkStyle()); | 585 state.applyPropertyToVisitedLinkStyle()); |
| 602 } | 586 } |
| 603 } | 587 } |
| 604 {% endmacro %} | 588 {% endmacro %} |
| 605 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 589 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
| 606 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 590 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
| 607 } // namespace blink | 591 } // namespace blink |
| OLD | NEW |