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

Unified Diff: third_party/WebKit/Source/core/css/cssom/StyleValue.cpp

Issue 1590193002: Partial implementation of inline StylePropertyMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@maps
Patch Set: Update tests Created 4 years, 10 months 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: 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;
}

Powered by Google App Engine
This is Rietveld 408576698