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

Unified Diff: third_party/WebKit/Source/core/css/CSSGradientValue.cpp

Issue 2158723002: Make CSSValuePair store const CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_cssparsersinglevalue_return_const
Patch Set: Review feedback Created 4 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: third_party/WebKit/Source/core/css/CSSGradientValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
index 57a1683cfa39ceccfb4a830ad588ec063c55f3a4..462ce6bd931298b3d642ada4f9ac88befcc57d7f 100644
--- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
@@ -481,7 +481,7 @@ void CSSGradientValue::addStops(Gradient* gradient, const CSSToLengthConversionD
}
}
-static float positionFromValue(CSSValue* value, const CSSToLengthConversionData& conversionData, const IntSize& size, bool isHorizontal)
+static float positionFromValue(const CSSValue* value, const CSSToLengthConversionData& conversionData, const IntSize& size, bool isHorizontal)
{
int origin = 0;
int sign = 1;
@@ -490,7 +490,7 @@ static float positionFromValue(CSSValue* value, const CSSToLengthConversionData&
// In this case the center of the gradient is given relative to an edge in the form of:
// [ top | bottom | right | left ] [ <percentage> | <length> ].
if (value->isValuePair()) {
- CSSValuePair& pair = toCSSValuePair(*value);
+ const CSSValuePair& pair = toCSSValuePair(*value);
CSSValueID originID = toCSSPrimitiveValue(pair.first()).getValueID();
value = &pair.second();
@@ -501,7 +501,7 @@ static float positionFromValue(CSSValue* value, const CSSToLengthConversionData&
}
}
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
+ const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value);
if (primitiveValue->isNumber())
return origin + sign * primitiveValue->getFloatValue() * conversionData.zoom();
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp ('k') | third_party/WebKit/Source/core/css/CSSValuePair.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698