Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Side by Side Diff: third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 2610893005: Migrate WTF::Vector::append() to ::push_back() [part 16 of N] (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 {% endif %} 95 {% endif %}
96 {% endfor %} 96 {% endfor %}
97 97
98 {% macro apply_animation(property_id, attribute, animation) %} 98 {% macro apply_animation(property_id, attribute, animation) %}
99 {% set vector = attribute|lower_first + "List()" %} 99 {% set vector = attribute|lower_first + "List()" %}
100 {{declare_initial_function(property_id)}} { 100 {{declare_initial_function(property_id)}} {
101 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); 101 CSS{{animation}}Data& data = state.style()->access{{animation}}s();
102 data.{{vector}}.clear(); 102 data.{{vector}}.clear();
103 data.{{vector}}.append(CSS{{animation}}Data::initial{{attribute}}()); 103 data.{{vector}}.push_back(CSS{{animation}}Data::initial{{attribute}}());
104 } 104 }
105 105
106 {{declare_inherit_function(property_id)}} { 106 {{declare_inherit_function(property_id)}} {
107 const CSS{{animation}}Data* parentData = state.parentStyle()->{{animation|lowe r}}s(); 107 const CSS{{animation}}Data* parentData = state.parentStyle()->{{animation|lowe r}}s();
108 if (!parentData) 108 if (!parentData)
109 applyInitial{{property_id}}(state); 109 applyInitial{{property_id}}(state);
110 else 110 else
111 state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}}; 111 state.style()->access{{animation}}s().{{vector}} = parentData->{{vector}};
112 } 112 }
113 113
114 {{declare_value_function(property_id)}} { 114 {{declare_value_function(property_id)}} {
115 CSS{{animation}}Data& data = state.style()->access{{animation}}s(); 115 CSS{{animation}}Data& data = state.style()->access{{animation}}s();
116 data.{{vector}}.clear(); 116 data.{{vector}}.clear();
117 for (auto& listValue : toCSSValueList(value)) 117 for (auto& listValue : toCSSValueList(value))
118 data.{{vector}}.append(CSSToStyleMap::mapAnimation{{attribute}}(*listValue)) ; 118 data.{{vector}}.push_back(CSSToStyleMap::mapAnimation{{attribute}}(*listValu e));
119 } 119 }
120 {% endmacro %} 120 {% endmacro %}
121 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}} 121 {{apply_animation('CSSPropertyAnimationDelay', 'Delay', 'Animation')}}
122 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}} 122 {{apply_animation('CSSPropertyAnimationDirection', 'Direction', 'Animation')}}
123 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}} 123 {{apply_animation('CSSPropertyAnimationDuration', 'Duration', 'Animation')}}
124 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}} 124 {{apply_animation('CSSPropertyAnimationFillMode', 'FillMode', 'Animation')}}
125 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima tion')}} 125 {{apply_animation('CSSPropertyAnimationIterationCount', 'IterationCount', 'Anima tion')}}
126 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}} 126 {{apply_animation('CSSPropertyAnimationName', 'Name', 'Animation')}}
127 {{apply_animation('CSSPropertyAnimationPlayState', 'PlayState', 'Animation')}} 127 {{apply_animation('CSSPropertyAnimationPlayState', 'PlayState', 'Animation')}}
128 {{apply_animation('CSSPropertyAnimationTimingFunction', 'TimingFunction', 'Anima tion')}} 128 {{apply_animation('CSSPropertyAnimationTimingFunction', 'TimingFunction', 'Anima tion')}}
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 : SVG_PAINTTYPE_URI_RGBCOLOR; 548 : SVG_PAINTTYPE_URI_RGBCOLOR;
549 } 549 }
550 {{set_value(property)}}(paintType, color, url, 550 {{set_value(property)}}(paintType, color, url,
551 state.applyPropertyToRegularStyle(), 551 state.applyPropertyToRegularStyle(),
552 state.applyPropertyToVisitedLinkStyle()); 552 state.applyPropertyToVisitedLinkStyle());
553 } 553 }
554 {% endmacro %} 554 {% endmacro %}
555 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}} 555 {{apply_svg_paint('CSSPropertyFill', 'FillPaint')}}
556 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}} 556 {{apply_svg_paint('CSSPropertyStroke', 'StrokePaint')}}
557 } // namespace blink 557 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698