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

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

Issue 1238943004: CSSValue Immediates: Replace CSSValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
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 c25ed31b0e276f1850137f0f6c38d5962f17f3ba..f81146183a93a6c193ff1d61f0148eb08d9aa21d 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 %}
@@ -513,8 +513,9 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
{{declare_value_function(property_id)}}
{
String url;
- if (value.isValueList()) {
- CSSValueList& list = toCSSValueList(value);
+ CSSValue valueToUse = value;
+ if (valueToUse.isValueList()) {
+ CSSValueList& list = toCSSValueList(valueToUse);
ASSERT(list.length() > 1);
if (!list.item(0).isPrimitiveValue())
@@ -525,10 +526,10 @@ static bool borderImageLengthMatchesAllSides(const BorderImageLengthBox& borderI
return;
url = primitiveValue.getStringValue();
- value = list.item(1);
+ valueToUse = list.item(1);
}
- if (value.isPrimitiveValue()) {
- CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
+ if (valueToUse.isPrimitiveValue()) {
+ 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,
« no previous file with comments | « Source/build/scripts/templates/StyleBuilder.cpp.tmpl ('k') | Source/build/scripts/templates/StyleBuilderFunctions.h.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698