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 "StyleBuilderFunctions.h" | 9 #include "StyleBuilderFunctions.h" |
10 | 10 |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 NamedGridLinesMap autoRepeatNamedGridLines; | 468 NamedGridLinesMap autoRepeatNamedGridLines; |
469 OrderedNamedGridLines autoRepeatOrderedNamedGridLines; | 469 OrderedNamedGridLines autoRepeatOrderedNamedGridLines; |
470 AutoRepeatType autoRepeatType; | 470 AutoRepeatType autoRepeatType; |
471 StyleBuilderConverter::convertGridTrackList(*value, trackSizes, namedGridLin
es, orderedNamedGridLines, autoRepeatTrackSizes, autoRepeatNamedGridLines, autoR
epeatOrderedNamedGridLines, autoRepeatInsertionPoint, autoRepeatType, state); | 471 StyleBuilderConverter::convertGridTrackList(*value, trackSizes, namedGridLin
es, orderedNamedGridLines, autoRepeatTrackSizes, autoRepeatNamedGridLines, autoR
epeatOrderedNamedGridLines, autoRepeatInsertionPoint, autoRepeatType, state); |
472 const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea(); | 472 const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea(); |
473 if (!namedGridAreas.isEmpty()) | 473 if (!namedGridAreas.isEmpty()) |
474 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGri
dAreas, namedGridLines, For{{type}}s); | 474 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGri
dAreas, namedGridLines, For{{type}}s); |
475 state.style()->setGridTemplate{{type}}s(trackSizes); | 475 state.style()->setGridTemplate{{type}}s(trackSizes); |
476 state.style()->setNamedGrid{{type}}Lines(namedGridLines); | 476 state.style()->setNamedGrid{{type}}Lines(namedGridLines); |
477 state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); | 477 state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); |
478 if (autoRepeatTrackSizes.size()) { | 478 state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); |
479 state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); | 479 state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsertionP
oint); |
480 state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsert
ionPoint); | 480 state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines)
; |
481 state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLi
nes); | 481 state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrderedN
amedGridLines); |
482 state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrde
redNamedGridLines); | 482 state.style()->setGridAutoRepeatType(autoRepeatType); |
483 state.style()->setGridAutoRepeatType(autoRepeatType); | |
484 } | |
485 } | 483 } |
486 {% endmacro %} | 484 {% endmacro %} |
487 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} | 485 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} |
488 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} | 486 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} |
489 | 487 |
490 {% macro apply_svg_paint(property_id, paint_type) %} | 488 {% macro apply_svg_paint(property_id, paint_type) %} |
491 {% set property = properties[property_id] %} | 489 {% set property = properties[property_id] %} |
492 {{declare_initial_function(property_id)}} | 490 {{declare_initial_function(property_id)}} |
493 { | 491 { |
494 {{set_value(property)}}( | 492 {{set_value(property)}}( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; | 533 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; |
536 } | 534 } |
537 {{set_value(property)}}(paintType, color, url, | 535 {{set_value(property)}}(paintType, color, url, |
538 state.applyPropertyToRegularStyle(), | 536 state.applyPropertyToRegularStyle(), |
539 state.applyPropertyToVisitedLinkStyle()); | 537 state.applyPropertyToVisitedLinkStyle()); |
540 } | 538 } |
541 {% endmacro %} | 539 {% endmacro %} |
542 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 540 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
543 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 541 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
544 } // namespace blink | 542 } // namespace blink |
OLD | NEW |