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

Unified Diff: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl

Issue 454133004: Use common converter for -webkit-column-[gap, width]. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/CSSProperties.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
diff --git a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
index 789dccccc5a63c15ad64e4c49fd5fefc1e150662..0cea6919f109885cbd9e5b85701202a5a2adda1d 100644
--- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -33,6 +33,13 @@ state.fontBuilder().{{property.setter}}
state.style()->{{property.setter}}
{%- endif %}
{% endmacro %}
+{% macro convert_and_set_value(property) %}
+{% if property.converter %}
+{{set_value(property)}}(StyleBuilderConverter::{{property.converter}}(state, value));
+{%- else %}
+{{set_value(property)}}(static_cast<{{property.type_name}}>(*toCSSPrimitiveValue(value)));
+{%- endif %}
+{% endmacro %}
namespace blink {
@@ -67,11 +74,7 @@ namespace blink {
{% if not property.custom_value %}
{{declare_value_function(property_id)}}
{
- {% if property.converter %}
- {{set_value(property)}}(StyleBuilderConverter::{{property.converter}}(state, value));
- {% else %}
- {{set_value(property)}}(static_cast<{{property.type_name}}>(*toCSSPrimitiveValue(value)));
- {% endif %}
+ {{convert_and_set_value(property)}}
}
{% endif %}
@@ -116,7 +119,7 @@ namespace blink {
{{apply_animation('CSSPropertyWebkitTransitionProperty', 'Property', 'Transition')}}
{{apply_animation('CSSPropertyWebkitTransitionTimingFunction', 'TimingFunction', 'Transition')}}
-{% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identity='CSSValueAuto', compute_length=false) %}
+{% macro apply_auto(property_id, auto_getter=none, auto_setter=none, auto_identity='CSSValueAuto') %}
{% set property = properties[property_id] %}
{% set auto_getter = auto_getter or 'hasAuto' + property.name_for_methods %}
{% set auto_setter = auto_setter or 'setHasAuto' + property.name_for_methods %}
@@ -142,17 +145,13 @@ namespace blink {
if (primitiveValue->getValueID() == {{auto_identity}})
state.style()->{{auto_setter}}();
else
- {% if compute_length %}
- {{set_value(property)}}(primitiveValue->computeLength<{{property.type_name}}>(state.cssToLengthConversionData()));
- {% else %}
- {{set_value(property)}}(*primitiveValue);
- {% endif %}
+ {{convert_and_set_value(property)}}
}
{% endmacro %}
{{apply_auto('CSSPropertyOrphans')}}
{{apply_auto('CSSPropertyWebkitColumnCount')}}
-{{apply_auto('CSSPropertyWebkitColumnGap', auto_getter='hasNormalColumnGap', auto_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal', compute_length=true)}}
-{{apply_auto('CSSPropertyWebkitColumnWidth', compute_length=true)}}
+{{apply_auto('CSSPropertyWebkitColumnGap', auto_getter='hasNormalColumnGap', auto_setter='setHasNormalColumnGap', auto_identity='CSSValueNormal')}}
+{{apply_auto('CSSPropertyWebkitColumnWidth')}}
{{apply_auto('CSSPropertyWidows')}}
{{apply_auto('CSSPropertyZIndex')}}
« no previous file with comments | « no previous file | Source/core/css/CSSProperties.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698