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

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: erm.. use DEFINE_STATIC_REF 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
Index: Source/core/css/CSSPrimitiveValueMappings.h
diff --git a/Source/core/css/CSSPrimitiveValueMappings.h b/Source/core/css/CSSPrimitiveValueMappings.h
index 67cd5ea2e3d74808e9aafdb5532dd543fcfef66f..2ec82356a8034b9fe49c4c023de7b990512b5a5c 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);

Powered by Google App Engine
This is Rietveld 408576698