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

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

Issue 179363005: Remove dependency on element in applying color properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
OLDNEW
1 {% from "macros.tmpl" import lower_first -%} 1 {% from "macros.tmpl" import lower_first -%}
2 2
3 {# 3 {#
4 This file is for property handlers which use the templating engine to 4 This file is for property handlers which use the templating engine to
5 reduce (handwritten) code duplication. 5 reduce (handwritten) code duplication.
6 6
7 The `properties' dict can be used to access a property's parameters in 7 The `properties' dict can be used to access a property's parameters in
8 jinja2 templates (i.e. setter, getter, initial, type_name) 8 jinja2 templates (i.e. setter, getter, initial, type_name)
9 -#} 9 -#}
10 10
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 state.style()->{{visited_link_setter}}(resolvedColor); 257 state.style()->{{visited_link_setter}}(resolvedColor);
258 } 258 }
259 259
260 {{ declare_value_function(property_id) }} 260 {{ declare_value_function(property_id) }}
261 { 261 {
262 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 262 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
263 263
264 if (state.applyPropertyToRegularStyle()) 264 if (state.applyPropertyToRegularStyle())
265 {{ set_value(property) }}(state.document().textLinkColors().colorFromPri mitiveValue(primitiveValue, state.style()->color())); 265 {{ set_value(property) }}(state.document().textLinkColors().colorFromPri mitiveValue(primitiveValue, state.style()->color()));
266 if (state.applyPropertyToVisitedLinkStyle()) 266 if (state.applyPropertyToVisitedLinkStyle())
267 state.style()->{{visited_link_setter}}(state.document().textLinkColors() .colorFromPrimitiveValue(primitiveValue, state.style()->color(), state.element() ->isLink() /* forVisitedLink */)); 267 state.style()->{{visited_link_setter}}(state.document().textLinkColors() .colorFromPrimitiveValue(primitiveValue, state.style()->color(), true));
268 } 268 }
269 {%- endmacro %} 269 {%- endmacro %}
270 270
271 {{ apply_color("CSSPropertyBackgroundColor", initial_color="RenderStyle::initial BackgroundColor") }} 271 {{ apply_color("CSSPropertyBackgroundColor", initial_color="RenderStyle::initial BackgroundColor") }}
272 {{ apply_color("CSSPropertyBorderBottomColor") }} 272 {{ apply_color("CSSPropertyBorderBottomColor") }}
273 {{ apply_color("CSSPropertyBorderLeftColor") }} 273 {{ apply_color("CSSPropertyBorderLeftColor") }}
274 {{ apply_color("CSSPropertyBorderRightColor") }} 274 {{ apply_color("CSSPropertyBorderRightColor") }}
275 {{ apply_color("CSSPropertyBorderTopColor") }} 275 {{ apply_color("CSSPropertyBorderTopColor") }}
276 {{ apply_color("CSSPropertyOutlineColor") }} 276 {{ apply_color("CSSPropertyOutlineColor") }}
277 {{ apply_color("CSSPropertyTextDecorationColor") }} 277 {{ apply_color("CSSPropertyTextDecorationColor") }}
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } else if (value->isImageValue() || value->isImageSetValue()) { 494 } else if (value->isImageValue() || value->isImageSetValue()) {
495 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage( {{property_id}}, value))); 495 {{ set_value(property) }}(ShapeValue::createImageValue(state.styleImage( {{property_id}}, value)));
496 } 496 }
497 } 497 }
498 {%- endmacro %} 498 {%- endmacro %}
499 499
500 {{ apply_value_shape("CSSPropertyShapeInside") }} 500 {{ apply_value_shape("CSSPropertyShapeInside") }}
501 {{ apply_value_shape("CSSPropertyShapeOutside") }} 501 {{ apply_value_shape("CSSPropertyShapeOutside") }}
502 502
503 } // namespace WebCore 503 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698