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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/cssom/StyleValue.h" 5 #include "core/css/cssom/StyleValue.h"
6 6
7 #include "bindings/core/v8/ScriptValue.h" 7 #include "bindings/core/v8/ScriptValue.h"
8 #include "core/css/cssom/SimpleLength.h"
8 9
9 namespace blink { 10 namespace blink {
10 11
11 StyleValue* StyleValue::create(const CSSValue& val) 12 StyleValue* StyleValue::create(const CSSValue& value)
12 { 13 {
13 // TODO: implement. 14 if (value.isPrimitiveValue()) {
15 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value);
16 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.
17 return SimpleLength::create(primitiveValue.getDoubleValue(), primiti veValue.typeWithCalcResolved());
18 }
19 }
20 // TODO: What if it is a list or pair?
21 // TODO: Implment the rest.
14 return nullptr; 22 return nullptr;
15 } 23 }
16 24
17 ScriptValue StyleValue::parse(ScriptState* state, const String& property, const String& cssText) 25 ScriptValue StyleValue::parse(ScriptState* state, const String& property, const String& cssText)
18 { 26 {
19 // TODO: implement. 27 // TODO: implement.
20 return ScriptValue(); 28 return ScriptValue();
21 } 29 }
22 30
23 } // namespace blink 31 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698