| Index: third_party/WebKit/Source/core/css/cssom/StyleValue.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValue.cpp b/third_party/WebKit/Source/core/css/cssom/StyleValue.cpp
|
| index e91a45915442b91137cfa7a19d71496fe2ec8397..c2c88d866ace34bdac1f94ad83d1240af6f6253d 100644
|
| --- a/third_party/WebKit/Source/core/css/cssom/StyleValue.cpp
|
| +++ b/third_party/WebKit/Source/core/css/cssom/StyleValue.cpp
|
| @@ -5,12 +5,20 @@
|
| #include "core/css/cssom/StyleValue.h"
|
|
|
| #include "bindings/core/v8/ScriptValue.h"
|
| +#include "core/css/cssom/SimpleLength.h"
|
|
|
| namespace blink {
|
|
|
| -StyleValue* StyleValue::create(const CSSValue& val)
|
| +StyleValue* StyleValue::create(const CSSValue& value)
|
| {
|
| - // TODO: implement.
|
| + if (value.isPrimitiveValue()) {
|
| + const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
|
| + if (primitiveValue.isLength() && !primitiveValue.isCalculated()) {
|
| + return SimpleLength::create(primitiveValue.getDoubleValue(), primitiveValue.typeWithCalcResolved());
|
| + }
|
| + }
|
| + // TODO: What if it is a list or pair?
|
| + // TODO: Implment the rest.
|
| return nullptr;
|
| }
|
|
|
|
|