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

Unified Diff: Source/core/css/CSSPrimitiveValueMappings.h

Issue 64293008: Wrap CSS length conversion arguments in an object (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: don't make it noncopyable ; clang doesn't do the RVO stuffs? Created 7 years, 1 month 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.cpp ('k') | Source/core/css/CSSToLengthConversionData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 1d5ee12ae6d5e46ca91872a31c6134fa3587baf2..b37f08404bd94cf896840874570c6fa12ba514fe 100644
--- a/Source/core/css/CSSPrimitiveValueMappings.h
+++ b/Source/core/css/CSSPrimitiveValueMappings.h
@@ -34,6 +34,7 @@
#include "core/css/CSSCalculationValue.h"
#include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSReflectionDirection.h"
+#include "core/css/CSSToLengthConversionData.h"
#include "core/platform/graphics/Path.h"
#include "core/rendering/style/LineClampValue.h"
#include "core/rendering/style/RenderStyleConstants.h"
@@ -4435,19 +4436,17 @@ enum LengthConversion {
PercentConversion = 1 << 2,
};
-template<int supported> Length CSSPrimitiveValue::convertToLength(const RenderStyle* style, const RenderStyle* rootStyle, double multiplier, bool computingFontSize)
+template<int supported> Length CSSPrimitiveValue::convertToLength(const CSSToLengthConversionData& conversionData)
{
ASSERT(!hasVariableReference());
- if ((supported & FixedConversion) && isFontRelativeLength() && (!style || !rootStyle))
- return Length(Undefined);
if ((supported & FixedConversion) && isLength())
- return computeLength<Length>(style, rootStyle, multiplier, computingFontSize);
+ return computeLength<Length>(conversionData);
if ((supported & PercentConversion) && isPercentage())
return Length(getDoubleValue(), Percent);
if ((supported & AutoConversion) && getValueID() == CSSValueAuto)
return Length(Auto);
if ((supported & FixedConversion) && (supported & PercentConversion) && isCalculated())
- return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier));
+ return Length(cssCalcValue()->toCalcValue(conversionData));
if ((supported & FixedConversion) && isViewportPercentageLength())
return viewportPercentageLength();
return Length(Undefined);
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/css/CSSToLengthConversionData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698