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/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 18859010: Move colorFromPrimitiveValue from StyleResolverState to TextLinkColors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/style/RenderStyle.cpp ('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 lower_first, wrap_with_condition -%} 1 {% from "macros.tmpl" import lower_first, wrap_with_condition -%}
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, condition) 8 jinja2 templates (i.e. setter, getter, initial, type_name, condition)
9 -#} 9 -#}
10 10
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); 316 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
317 317
318 {%- if inherit_color %} 318 {%- if inherit_color %}
319 if (primitiveValue->getValueID() == CSSValueCurrentcolor) { 319 if (primitiveValue->getValueID() == CSSValueCurrentcolor) {
320 applyInherit{{property_id}}(styleResolver, state); 320 applyInherit{{property_id}}(styleResolver, state);
321 return; 321 return;
322 } 322 }
323 {%- endif %} 323 {%- endif %}
324 324
325 if (state.applyPropertyToRegularStyle()) 325 if (state.applyPropertyToRegularStyle())
326 {{ set_value(property) }}(state.resolveColorFromPrimitiveValue(primitive Value)); 326 {{ set_value(property) }}(state.document()->textLinkColors().colorFromPr imitiveValue(primitiveValue, state.style()->visitedDependentColor(CSSPropertyCol or)));
327 if (state.applyPropertyToVisitedLinkStyle()) 327 if (state.applyPropertyToVisitedLinkStyle())
328 state.style()->{{visited_link_setter}}(state.resolveColorFromPrimitiveVa lue(primitiveValue, /* forVisitedLink */ true)); 328 state.style()->{{visited_link_setter}}(state.document()->textLinkColors( ).colorFromPrimitiveValue(primitiveValue, state.style()->visitedDependentColor(C SSPropertyColor), state.element()->isLink() /* forVisitedLink */));
329 } 329 }
330 {%- endcall %} 330 {%- endcall %}
331 {%- endmacro %} 331 {%- endmacro %}
332 332
333 {{ apply_color("CSSPropertyBackgroundColor", default_getter="invalidColor") }} 333 {{ apply_color("CSSPropertyBackgroundColor", default_getter="invalidColor") }}
334 {{ apply_color("CSSPropertyBorderBottomColor") }} 334 {{ apply_color("CSSPropertyBorderBottomColor") }}
335 {{ apply_color("CSSPropertyBorderLeftColor") }} 335 {{ apply_color("CSSPropertyBorderLeftColor") }}
336 {{ apply_color("CSSPropertyBorderRightColor") }} 336 {{ apply_color("CSSPropertyBorderRightColor") }}
337 {{ apply_color("CSSPropertyBorderTopColor") }} 337 {{ apply_color("CSSPropertyBorderTopColor") }}
338 {{ apply_color("CSSPropertyColor", inherit_color=true, default_getter="invalidCo lor", initial_color="RenderStyle::initialColor") }} 338 {{ apply_color("CSSPropertyColor", inherit_color=true, default_getter="invalidCo lor", initial_color="RenderStyle::initialColor") }}
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 break; 491 break;
492 } 492 }
493 } else { 493 } else {
494 Length marqueeLength = styleResolver->convertToIntLength(primitiveValue, state.style(), state.rootElementStyle()); 494 Length marqueeLength = styleResolver->convertToIntLength(primitiveValue, state.style(), state.rootElementStyle());
495 if (!marqueeLength.isUndefined()) 495 if (!marqueeLength.isUndefined())
496 state.style()->setMarqueeIncrement(marqueeLength); 496 state.style()->setMarqueeIncrement(marqueeLength);
497 } 497 }
498 } 498 }
499 499
500 } // namespace WebCore 500 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/style/RenderStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698