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

Unified Diff: Source/core/css/resolver/TransformBuilder.cpp

Issue 1226123008: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
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
« no previous file with comments | « Source/core/css/resolver/TransformBuilder.h ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/TransformBuilder.cpp
diff --git a/Source/core/css/resolver/TransformBuilder.cpp b/Source/core/css/resolver/TransformBuilder.cpp
index df926fad3634784968b811ec56b8fad75f56e054..306eb86555e7548f589a9d0298aa172215abdd0e 100644
--- a/Source/core/css/resolver/TransformBuilder.cpp
+++ b/Source/core/css/resolver/TransformBuilder.cpp
@@ -79,7 +79,7 @@ static TransformOperation::OperationType getTransformOperationType(CSSValueID ty
}
}
-void TransformBuilder::createTransformOperations(CSSValue& inValue, const CSSToLengthConversionData& conversionData, TransformOperations& outOperations)
+void TransformBuilder::createTransformOperations(const CSSValue& inValue, const CSSToLengthConversionData& conversionData, TransformOperations& outOperations)
{
ASSERT(!outOperations.size());
if (!inValue.isValueList()) {
@@ -92,7 +92,7 @@ void TransformBuilder::createTransformOperations(CSSValue& inValue, const CSSToL
CSSFunctionValue& transformValue = toCSSFunctionValue(value);
TransformOperation::OperationType transformType = getTransformOperationType(transformValue.functionType());
- CSSPrimitiveValue firstValue = toCSSPrimitiveValue(transformValue.item(0));
+ const CSSPrimitiveValue& firstValue = toCSSPrimitiveValue(transformValue.item(0));
switch (transformType) {
case TransformOperation::Scale:
@@ -106,7 +106,7 @@ void TransformBuilder::createTransformOperations(CSSValue& inValue, const CSSToL
sx = firstValue.getDoubleValue();
if (transformType != TransformOperation::ScaleX) {
if (transformValue.length() > 1) {
- CSSPrimitiveValue secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
sy = secondValue.getDoubleValue();
} else {
sy = sx;
@@ -142,7 +142,7 @@ void TransformBuilder::createTransformOperations(CSSValue& inValue, const CSSToL
tx = convertToFloatLength(firstValue, conversionData);
if (transformType != TransformOperation::TranslateX) {
if (transformValue.length() > 1) {
- CSSPrimitiveValue secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
ty = convertToFloatLength(secondValue, conversionData);
}
}
@@ -178,9 +178,9 @@ void TransformBuilder::createTransformOperations(CSSValue& inValue, const CSSToL
break;
}
case TransformOperation::Rotate3D: {
- CSSPrimitiveValue secondValue = toCSSPrimitiveValue(transformValue.item(1));
- CSSPrimitiveValue thirdValue = toCSSPrimitiveValue(transformValue.item(2));
- CSSPrimitiveValue fourthValue = toCSSPrimitiveValue(transformValue.item(3));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& thirdValue = toCSSPrimitiveValue(transformValue.item(2));
+ const CSSPrimitiveValue& fourthValue = toCSSPrimitiveValue(transformValue.item(3));
double x = firstValue.getDoubleValue();
double y = secondValue.getDoubleValue();
double z = thirdValue.getDoubleValue();
@@ -200,7 +200,7 @@ void TransformBuilder::createTransformOperations(CSSValue& inValue, const CSSToL
angleX = angle;
if (transformType == TransformOperation::Skew) {
if (transformValue.length() > 1) {
- CSSPrimitiveValue secondValue = toCSSPrimitiveValue(transformValue.item(1));
+ const CSSPrimitiveValue& secondValue = toCSSPrimitiveValue(transformValue.item(1));
angleY = secondValue.computeDegrees();
}
}
« no previous file with comments | « Source/core/css/resolver/TransformBuilder.h ('k') | Source/core/css/resolver/ViewportStyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698