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

Unified Diff: Source/core/css/CSSPrimitiveValue.cpp

Issue 1314783002: Made all const methods on CSSPrimitiveValue have the const keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_quad
Patch Set: Rebase branch onto master Created 5 years, 4 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/CSSPrimitiveValue.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.cpp
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index fd077173cd72db4eba3c834f2875e45e44b595e5..477da87b9ae30526333df3d53120fc81f742c2fa 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -467,7 +467,7 @@ void CSSPrimitiveValue::cleanup()
}
}
-double CSSPrimitiveValue::computeSeconds()
+double CSSPrimitiveValue::computeSeconds() const
{
ASSERT(isTime() || (isCalculated() && cssCalcValue()->category() == CalcTime));
UnitType currentType = isCalculated() ? cssCalcValue()->expressionNode()->typeWithCalcResolved() : type();
@@ -498,42 +498,42 @@ double CSSPrimitiveValue::computeDegrees() const
}
}
-template<> int CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> int CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return roundForImpreciseConversion<int>(computeLengthDouble(conversionData));
}
-template<> unsigned CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> unsigned CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return roundForImpreciseConversion<unsigned>(computeLengthDouble(conversionData));
}
-template<> Length CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> Length CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return Length(clampToCSSLengthRange(computeLengthDouble(conversionData)), Fixed);
}
-template<> short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return roundForImpreciseConversion<short>(computeLengthDouble(conversionData));
}
-template<> unsigned short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> unsigned short CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return roundForImpreciseConversion<unsigned short>(computeLengthDouble(conversionData));
}
-template<> float CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> float CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return static_cast<float>(computeLengthDouble(conversionData));
}
-template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData)
+template<> double CSSPrimitiveValue::computeLength(const CSSToLengthConversionData& conversionData) const
{
return computeLengthDouble(conversionData);
}
-double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& conversionData)
+double CSSPrimitiveValue::computeLengthDouble(const CSSToLengthConversionData& conversionData) const
{
// The logic in this function is duplicated in MediaValues::computeLength
// because MediaValues::computeLength needs nearly identical logic, but we haven't found a way to make
@@ -682,7 +682,7 @@ double CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor(UnitType unitTyp
return factor;
}
-Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conversionData)
+Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conversionData) const
{
if (isLength())
return computeLength<Length>(conversionData);
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698