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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase please work Created 4 years, 3 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 | third_party/WebKit/Source/core/animation/BasicShapeInterpolationFunctions.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 be006405746097cec04a4057975aa5b50506ff3f..2799b61bf90393d62a96d2c2391a43f8370fd733 100644
--- a/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
@@ -39,8 +39,11 @@ state.style()->{{property.setter}}
{% macro convert_and_set_value(property) %}
{% if property.converter %}
{{set_value(property)}}(StyleBuilderConverter::{{property.converter}}(state, value));
-{%- else %}
+{# TODO(sashab): Remove this list from this file. #}
+{% elif property.type_name in ['short', 'unsigned short', 'int', 'unsigned int', 'unsigned', 'float', 'LineClampValue'] %}
{{set_value(property)}}(toCSSPrimitiveValue(value).convertTo<{{property.type_name}}>());
+{%- else %}
+{{set_value(property)}}(toCSSIdentifierValue(value).convertTo<{{property.type_name}}>());
{%- endif %}
{% endmacro %}
{% macro set_is_inherited(property) %}
@@ -153,7 +156,7 @@ namespace blink {
{{declare_value_function(property_id)}}
{
- if (value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() == {{auto_identity}})
+ if (value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID() == {{auto_identity}})
state.style()->{{auto_setter}}();
else
{{convert_and_set_value(property)}}
@@ -348,8 +351,8 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
state.style()->clear{{action}}Directives();
if (!value.isValueList()) {
- DCHECK(value.isPrimitiveValue());
- DCHECK_EQ(toCSSPrimitiveValue(value).getValueID(), CSSValueNone);
+ DCHECK(value.isIdentifierValue());
+ DCHECK_EQ(toCSSIdentifierValue(value).getValueID(), CSSValueNone);
return;
}
@@ -535,9 +538,9 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
if (localValue->isURIValue()) {
paintType = SVG_PAINTTYPE_URI;
url = toCSSURIValue(localValue)->value();
- } else if (localValue->isPrimitiveValue() && toCSSPrimitiveValue(localValue)->getValueID() == CSSValueNone) {
+ } else if (localValue->isIdentifierValue() && toCSSIdentifierValue(localValue)->getValueID() == CSSValueNone) {
paintType = url.isEmpty() ? SVG_PAINTTYPE_NONE : SVG_PAINTTYPE_URI_NONE;
- } else if (localValue->isPrimitiveValue() && toCSSPrimitiveValue(localValue)->getValueID() == CSSValueCurrentcolor) {
+ } else if (localValue->isIdentifierValue() && toCSSIdentifierValue(localValue)->getValueID() == CSSValueCurrentcolor) {
color = state.style()->color();
paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
} else {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/BasicShapeInterpolationFunctions.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698