Index: third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp |
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp |
index 065656944d8ea8ce30a1f4482fee828e663e099a..e42c5e63ba43535721543535604831720457fa43 100644 |
--- a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp |
+++ b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp |
@@ -6,8 +6,10 @@ |
#include "core/css/CSSImageValue.h" |
#include "core/css/CSSValue.h" |
+#include "core/css/cssom/CSSCalcLength.h" |
#include "core/css/cssom/CSSKeywordValue.h" |
#include "core/css/cssom/CSSNumberValue.h" |
+#include "core/css/cssom/CSSOMTypes.h" |
#include "core/css/cssom/CSSSimpleLength.h" |
#include "core/css/cssom/CSSStyleValue.h" |
#include "core/css/cssom/CSSStyleVariableReferenceValue.h" |
@@ -38,6 +40,13 @@ CSSStyleValue* createStyleValueWithPropertyInternal(CSSPropertyID propertyID, |
// TODO(meade): Implement other properties. |
break; |
} |
+ if (value.isPrimitiveValue() && toCSSPrimitiveValue(value).isCalculated()) { |
+ // TODO(meade): Handle other calculated types, e.g. angles here. |
+ if (CSSOMTypes::propertyCanTakeType(propertyID, |
+ CSSStyleValue::CalcLengthType)) { |
+ return CSSCalcLength::fromCSSValue(toCSSPrimitiveValue(value)); |
+ } |
+ } |
return nullptr; |
} |