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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
516 state.style()->set{{alignment_type}}(*primitiveValue); | 516 state.style()->set{{alignment_type}}(*primitiveValue); |
517 // FIXME: We should clear the overflow-alignment mode here and probably | 517 // FIXME: We should clear the overflow-alignment mode here and probably |
518 // also set it in the initial and inherit handlers | 518 // also set it in the initial and inherit handlers |
519 } | 519 } |
520 } | 520 } |
521 {% endmacro %} | 521 {% endmacro %} |
522 {{apply_alignment('CSSPropertyJustifySelf', 'JustifySelf')}} | 522 {{apply_alignment('CSSPropertyJustifySelf', 'JustifySelf')}} |
523 {{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} | 523 {{apply_alignment('CSSPropertyAlignItems', 'AlignItems')}} |
524 {{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} | 524 {{apply_alignment('CSSPropertyAlignSelf', 'AlignSelf')}} |
525 | 525 |
526 {% macro apply_alignment1(property_id, alignment_type) %} | |
cbiesinger
2014/06/21 00:45:23
That is a terrible name for this macro. Please ren
| |
527 {{declare_value_function(property_id)}} | |
528 { | |
529 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | |
530 if (Pair* pairValue = primitiveValue->getPairValue()) { | |
531 if (pairValue->first()->getValueID() == CSSValueLegacy) { | |
532 state.style()->set{{alignment_type}}IsLegacy(true); | |
533 state.style()->set{{alignment_type}}(*pairValue->second()); | |
534 } else { | |
535 state.style()->set{{alignment_type}}IsLegacy(false); | |
536 state.style()->set{{alignment_type}}(*pairValue->first()); | |
537 state.style()->set{{alignment_type}}OverflowAlignment(*pairValue->se cond()); | |
538 } | |
539 } else { | |
540 state.style()->set{{alignment_type}}IsLegacy(false); | |
541 state.style()->set{{alignment_type}}(*primitiveValue); | |
542 // FIXME: We should clear the overflow-alignment mode here and probably | |
543 // also set it in the initial and inherit handlers | |
544 } | |
545 } | |
546 {% endmacro %} | |
547 {{apply_alignment1('CSSPropertyJustifyItems', 'JustifyItems')}} | |
548 | |
526 {% macro apply_svg_paint(property_id, paint_type) %} | 549 {% macro apply_svg_paint(property_id, paint_type) %} |
527 {% set property = properties[property_id] %} | 550 {% set property = properties[property_id] %} |
528 {{declare_initial_function(property_id)}} | 551 {{declare_initial_function(property_id)}} |
529 { | 552 { |
530 {{set_value(property)}}( | 553 {{set_value(property)}}( |
531 SVGRenderStyle::initial{{paint_type}}Type(), | 554 SVGRenderStyle::initial{{paint_type}}Type(), |
532 SVGRenderStyle::initial{{paint_type}}Color(), | 555 SVGRenderStyle::initial{{paint_type}}Color(), |
533 SVGRenderStyle::initial{{paint_type}}Uri(), | 556 SVGRenderStyle::initial{{paint_type}}Uri(), |
534 state.applyPropertyToRegularStyle(), | 557 state.applyPropertyToRegularStyle(), |
535 state.applyPropertyToVisitedLinkStyle()); | 558 state.applyPropertyToVisitedLinkStyle()); |
(...skipping 26 matching lines...) Expand all Loading... | |
562 color, | 585 color, |
563 svgPaint->uri(), | 586 svgPaint->uri(), |
564 state.applyPropertyToRegularStyle(), | 587 state.applyPropertyToRegularStyle(), |
565 state.applyPropertyToVisitedLinkStyle()); | 588 state.applyPropertyToVisitedLinkStyle()); |
566 } | 589 } |
567 } | 590 } |
568 {% endmacro %} | 591 {% endmacro %} |
569 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 592 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
570 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 593 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
571 } // namespace WebCore | 594 } // namespace WebCore |
OLD | NEW |