Chromium Code Reviews| Index: third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
| diff --git a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
| index 2b202188490d5e323b72e42a3e29bdbe3214776d..1672e9df7f4f3ea76256676483bc3020af7595f9 100644 |
| --- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
| +++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl |
| @@ -320,6 +320,39 @@ static bool borderImageLengthMatchesAllSides( |
| {{apply_color('CSSPropertyWebkitTextFillColor')}} |
| {{apply_color('CSSPropertyWebkitTextStrokeColor')}} |
| +{% macro apply_auto_color(property_id) %} |
| +{% set property = properties[property_id] %} |
| +{% set visited_link_setter = 'setVisitedLink' + property.name_for_methods %} |
| +{{declare_initial_function(property_id)}} { |
| + StyleAutoColor color = StyleAutoColor::autoColor(); |
| + if (state.applyPropertyToRegularStyle()) |
| + {{set_value(property)}}(color); |
| + if (state.applyPropertyToVisitedLinkStyle()) |
| + state.style()->{{visited_link_setter}}(color); |
| +} |
| + |
| +{{declare_inherit_function(property_id)}} { |
| + // Visited link style can never explicitly inherit from parent visited link |
| + // style so no separate getters are needed. |
| + StyleAutoColor color = state.parentStyle()->{{property.getter}}(); |
| + if (state.applyPropertyToRegularStyle()) |
| + {{set_value(property)}}(color); |
| + if (state.applyPropertyToVisitedLinkStyle()) |
| + state.style()->{{visited_link_setter}}(color); |
| +} |
| + |
| +{{declare_value_function(property_id)}} |
| +{ |
| + if (state.applyPropertyToRegularStyle()) |
| + {{set_value(property)}}(StyleBuilderConverter::convertStyleAutoColor(state, value)); |
| + if (state.applyPropertyToVisitedLinkStyle()) { |
| + state.style()->{{visited_link_setter}}( |
| + StyleBuilderConverter::convertStyleAutoColor(state, value, true)); |
| + } |
| +} |
| +{% endmacro %} |
| +{{apply_auto_color('CSSPropertyCaretColor') }} |
|
Timothy Loh
2016/11/28 03:11:21
Since this is only for a single property, it's bet
Manuel Rego
2016/11/28 10:47:54
Ok I'll move it.
Anyway, as I said it's supposed t
|
| + |
| {% macro apply_counter(property_id, action) %} |
| {% set property = properties[property_id] %} |
| {{declare_initial_function(property_id)}} { |