Chromium Code Reviews| 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..f3f4e4d35654c8d0194b0ad9a8fc53d77ffa27f7 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()) { |
|
Timothy Loh
2016/02/09 07:29:32
doesn't work for calcs btw, they return true for i
meade_UTC10
2016/02/10 05:55:39
Done.
|
| + return SimpleLength::create(primitiveValue.getDoubleValue(), primitiveValue.typeWithCalcResolved()); |
| + } |
| + } |
| + // TODO: What if it is a list or pair? |
| + // TODO: Implment the rest. |
| return nullptr; |
| } |