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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 { | 453 { |
454 state.style()->setGridTemplate{{type}}s(state.parentStyle()->gridTemplate{{t
ype}}s()); | 454 state.style()->setGridTemplate{{type}}s(state.parentStyle()->gridTemplate{{t
ype}}s()); |
455 state.style()->setNamedGrid{{type}}Lines(state.parentStyle()->namedGrid{{typ
e}}Lines()); | 455 state.style()->setNamedGrid{{type}}Lines(state.parentStyle()->namedGrid{{typ
e}}Lines()); |
456 state.style()->setOrderedNamedGrid{{type}}Lines(state.parentStyle()->ordered
NamedGrid{{type}}Lines()); | 456 state.style()->setOrderedNamedGrid{{type}}Lines(state.parentStyle()->ordered
NamedGrid{{type}}Lines()); |
457 } | 457 } |
458 | 458 |
459 {{declare_value_function(property_id)}} | 459 {{declare_value_function(property_id)}} |
460 { | 460 { |
461 Vector<GridTrackSize> trackSizes; | 461 Vector<GridTrackSize> trackSizes; |
462 Vector<GridTrackSize> autoRepeatTrackSizes; | 462 Vector<GridTrackSize> autoRepeatTrackSizes; |
463 size_t autoRepeatInsertionPoint; | |
464 NamedGridLinesMap namedGridLines; | 463 NamedGridLinesMap namedGridLines; |
465 OrderedNamedGridLines orderedNamedGridLines; | 464 OrderedNamedGridLines orderedNamedGridLines; |
466 NamedGridLinesMap autoRepeatNamedGridLines; | 465 NamedGridLinesMap autoRepeatNamedGridLines; |
467 OrderedNamedGridLines autoRepeatOrderedNamedGridLines; | 466 OrderedNamedGridLines autoRepeatOrderedNamedGridLines; |
468 AutoRepeatType autoRepeatType; | 467 AutoRepeatType autoRepeatType = ComputedStyle::initialGridAutoRepeatType(); |
| 468 size_t autoRepeatInsertionPoint = ComputedStyle::initialGridAutoRepeatInsert
ionPoint(); |
469 StyleBuilderConverter::convertGridTrackList(*value, trackSizes, namedGridLin
es, orderedNamedGridLines, autoRepeatTrackSizes, autoRepeatNamedGridLines, autoR
epeatOrderedNamedGridLines, autoRepeatInsertionPoint, autoRepeatType, state); | 469 StyleBuilderConverter::convertGridTrackList(*value, trackSizes, namedGridLin
es, orderedNamedGridLines, autoRepeatTrackSizes, autoRepeatNamedGridLines, autoR
epeatOrderedNamedGridLines, autoRepeatInsertionPoint, autoRepeatType, state); |
470 const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea(); | 470 const NamedGridAreaMap& namedGridAreas = state.style()->namedGridArea(); |
471 if (!namedGridAreas.isEmpty()) | 471 if (!namedGridAreas.isEmpty()) |
472 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGri
dAreas, namedGridLines, For{{type}}s); | 472 StyleBuilderConverter::createImplicitNamedGridLinesFromGridArea(namedGri
dAreas, namedGridLines, For{{type}}s); |
473 state.style()->setGridTemplate{{type}}s(trackSizes); | 473 state.style()->setGridTemplate{{type}}s(trackSizes); |
474 state.style()->setNamedGrid{{type}}Lines(namedGridLines); | 474 state.style()->setNamedGrid{{type}}Lines(namedGridLines); |
475 state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); | 475 state.style()->setOrderedNamedGrid{{type}}Lines(orderedNamedGridLines); |
476 if (autoRepeatTrackSizes.size()) { | 476 state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); |
477 state.style()->setGridAutoRepeat{{type}}s(autoRepeatTrackSizes); | 477 state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsertionP
oint); |
478 state.style()->setGridAutoRepeat{{type}}sInsertionPoint(autoRepeatInsert
ionPoint); | 478 state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLines)
; |
479 state.style()->setAutoRepeatNamedGrid{{type}}Lines(autoRepeatNamedGridLi
nes); | 479 state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrderedN
amedGridLines); |
480 state.style()->setAutoRepeatOrderedNamedGrid{{type}}Lines(autoRepeatOrde
redNamedGridLines); | 480 state.style()->setGridAutoRepeatType(autoRepeatType); |
481 state.style()->setGridAutoRepeatType(autoRepeatType); | |
482 } | |
483 } | 481 } |
484 {% endmacro %} | 482 {% endmacro %} |
485 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} | 483 {{apply_grid_template('CSSPropertyGridTemplateColumns', 'Column')}} |
486 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} | 484 {{apply_grid_template('CSSPropertyGridTemplateRows', 'Row')}} |
487 | 485 |
488 {% macro apply_svg_paint(property_id, paint_type) %} | 486 {% macro apply_svg_paint(property_id, paint_type) %} |
489 {% set property = properties[property_id] %} | 487 {% set property = properties[property_id] %} |
490 {{declare_initial_function(property_id)}} | 488 {{declare_initial_function(property_id)}} |
491 { | 489 { |
492 {{set_value(property)}}( | 490 {{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; | 531 paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_R
GBCOLOR; |
534 } | 532 } |
535 {{set_value(property)}}(paintType, color, url, | 533 {{set_value(property)}}(paintType, color, url, |
536 state.applyPropertyToRegularStyle(), | 534 state.applyPropertyToRegularStyle(), |
537 state.applyPropertyToVisitedLinkStyle()); | 535 state.applyPropertyToVisitedLinkStyle()); |
538 } | 536 } |
539 {% endmacro %} | 537 {% endmacro %} |
540 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} | 538 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} |
541 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} | 539 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} |
542 } // namespace blink | 540 } // namespace blink |
OLD | NEW |