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 state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); | 478 if (autoRepeatTrackSizes.size()) { |
479 state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsertionP
oint); | 479 state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); |
480 state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines)
; | 480 state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsert
ionPoint); |
481 state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrderedN
amedGridLines); | 481 state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLi
nes); |
482 state.style()->setGridAutoRepeatType(autoRepeatType); | 482 state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrde
redNamedGridLines); |
| 483 state.style()->setGridAutoRepeatType(autoRepeatType); |
| 484 } |
483 } | 485 } |
484 {% endmacro %} | 486 {% endmacro %} |
485 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} | 487 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} |
486 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} | 488 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} |
487 | 489 |
488 {% macro apply_svg_paint(property_id, paint_type) %} | 490 {% macro apply_svg_paint(property_id, paint_type) %} |
489 {% set property = properties[property_id] %} | 491 {% set property = properties[property_id] %} |
490 {{declare_initial_function(property_id)}} | 492 {{declare_initial_function(property_id)}} |
491 { | 493 { |
492 {{set_value(property)}}( | 494 {{set_value(property)}}( |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; | 535 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; |
534 } | 536 } |
535 {{set_value(property)}}(paintType, color, url, | 537 {{set_value(property)}}(paintType, color, url, |
536 state.applyPropertyToRegularStyle(), | 538 state.applyPropertyToRegularStyle(), |
537 state.applyPropertyToVisitedLinkStyle()); | 539 state.applyPropertyToVisitedLinkStyle()); |
538 } | 540 } |
539 {% endmacro %} | 541 {% endmacro %} |
540 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 542 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
541 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 543 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
542 } // namespace blink | 544 } // namespace blink |
OLD | NEW |