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 8208bbbc55c2c625c2c10bca169d44b36396a2da..3dec97c41801ff859ae5439129a43d7d66c4df24 100644 |
--- a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp |
+++ b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp |
@@ -5,7 +5,7 @@ |
#include "core/css/cssom/StyleValueFactory.h" |
#include "core/css/CSSValue.h" |
-#include "core/css/cssom/CSSSimpleLength.h" |
+#include "core/css/cssom/CSSLengthValue.h" |
#include "core/css/cssom/CSSStyleValue.h" |
#include "core/css/cssom/TransformValue.h" |
@@ -17,8 +17,8 @@ CSSStyleValueVector StyleValueFactory::cssValueToStyleValueVector(CSSPropertyID |
if (value.isPrimitiveValue()) { |
const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
- if (primitiveValue.isLength() && !primitiveValue.isCalculated()) { |
- styleValueVector.append(CSSSimpleLength::create(primitiveValue.getDoubleValue(), primitiveValue.typeWithCalcResolved())); |
+ if (primitiveValue.isLength()) { |
+ styleValueVector.append(CSSLengthValue::fromCSSValue(value)); |
return styleValueVector; |
} |
} |
@@ -34,4 +34,13 @@ CSSStyleValueVector StyleValueFactory::cssValueToStyleValueVector(CSSPropertyID |
return styleValueVector; |
} |
+CSSStyleValue* StyleValueFactory::cssValueToSingleStyleValue(CSSPropertyID propertyID, const CSSValue& value) |
+{ |
+ CSSStyleValueVector styleValueVector = StyleValueFactory::cssValueToStyleValueVector(propertyID, value); |
+ if (styleValueVector.size() != 1) |
+ return nullptr; |
+ |
+ return styleValueVector[0]; |
+} |
+ |
} // namespace blink |