| 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 e3cb394e2959d9ce5f63215fd7eaecb803618db5..5a7614927bc396fab7a5d3a66312a3f1180e2b58 100644
|
| --- a/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| +++ b/Source/build/scripts/templates/StyleBuilderFunctions.cpp.tmpl
|
| @@ -23,7 +23,7 @@ void StyleBuilderFunctions::applyInitial{{property_id}}(StyleResolverState& stat
|
| void StyleBuilderFunctions::applyInherit{{property_id}}(StyleResolverState& state)
|
| {%- endmacro %}
|
| {% macro declare_value_function(property_id) %}
|
| -void StyleBuilderFunctions::applyValue{{property_id}}(StyleResolverState& state, CSSValue value)
|
| +void StyleBuilderFunctions::applyValue{{property_id}}(StyleResolverState& state, const CSSValue& value)
|
| {%- endmacro %}
|
| {% macro set_value(property) %}
|
| {% if property.svg %}
|
| @@ -142,7 +142,7 @@ namespace blink {
|
| if (!value.isPrimitiveValue())
|
| return;
|
|
|
| - CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(value);
|
| + const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
|
| if (primitiveValue.getValueID() == {{auto_identity}})
|
| state.style()->{{auto_setter}}();
|
| else
|
| @@ -355,11 +355,11 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
|
| continue;
|
|
|
| Pair* pair = toCSSPrimitiveValue(currValue).getPairValue();
|
| - if (!pair || !pair->first() || !pair->second())
|
| + if (!pair)
|
| continue;
|
|
|
| - AtomicString identifier(toCSSPrimitiveValue(*pair->first()).getStringValue());
|
| - int value = toCSSPrimitiveValue(*pair->second()).getIntValue();
|
| + AtomicString identifier(pair->first().getStringValue());
|
| + int value = pair->second().getIntValue();
|
| CounterDirectives& directives = map.add(identifier, CounterDirectives()).storedValue->value;
|
| {% if action == 'Reset' %}
|
| directives.setResetValue(value);
|
| @@ -513,22 +513,23 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
|
| {{declare_value_function(property_id)}}
|
| {
|
| String url;
|
| - if (value.isValueList()) {
|
| - CSSValueList& list = toCSSValueList(value);
|
| + NullableCSSValue valueToUse = value;
|
| + if (valueToUse->isValueList()) {
|
| + CSSValueList& list = toCSSValueList(*valueToUse);
|
| ASSERT(list.length() > 1);
|
|
|
| if (!list.item(0).isPrimitiveValue())
|
| return;
|
|
|
| - CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(list.item(0));
|
| + const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(list.item(0));
|
| if (!primitiveValue.isURI())
|
| return;
|
|
|
| url = primitiveValue.getStringValue();
|
| - value = list.item(1);
|
| + valueToUse = list.item(1);
|
| }
|
| - if (value.isPrimitiveValue()) {
|
| - CSSPrimitiveValue primitiveValue = toCSSPrimitiveValue(value);
|
| + if (valueToUse->isPrimitiveValue()) {
|
| + const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(*valueToUse);
|
| Color color;
|
| SVGPaintType paintType = SVG_PAINTTYPE_RGBCOLOR;
|
| if (primitiveValue.getValueID() == CSSValueNone) {
|
| @@ -540,7 +541,7 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
|
| color = state.style()->color();
|
| paintType = url.isEmpty() ? SVG_PAINTTYPE_CURRENTCOLOR : SVG_PAINTTYPE_URI_CURRENTCOLOR;
|
| } else {
|
| - color = StyleBuilderConverter::convertColor(state, value);
|
| + color = StyleBuilderConverter::convertColor(state, *valueToUse);
|
| paintType = url.isEmpty() ? SVG_PAINTTYPE_RGBCOLOR : SVG_PAINTTYPE_URI_RGBCOLOR;
|
| }
|
| {{set_value(property)}}(paintType, color, url,
|
|
|