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

Side by Side Diff: third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp

Issue 2367663002: [WIP] Attempt to move everything cssom into a cssom namespace (Closed)
Patch Set: Created 4 years, 2 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/CSSStyleValue.h" 5 #include "core/css/cssom/CSSStyleValue.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "bindings/core/v8/ScriptValue.h" 8 #include "bindings/core/v8/ScriptValue.h"
9 #include "bindings/core/v8/ToV8.h" 9 #include "bindings/core/v8/ToV8.h"
10 #include "core/StylePropertyShorthand.h" 10 #include "core/StylePropertyShorthand.h"
11 #include "core/css/cssom/StyleValueFactory.h" 11 #include "core/css/cssom/StyleValueFactory.h"
12 #include "core/css/parser/CSSParser.h" 12 #include "core/css/parser/CSSParser.h"
13 13
14 namespace blink { 14 namespace blink {
15 namespace cssom {
15 16
16 ScriptValue CSSStyleValue::parse(ScriptState* scriptState, const String& propert yName, const String& value, ExceptionState& exceptionState) 17 ScriptValue CSSStyleValue::parse(ScriptState* scriptState, const String& propert yName, const String& value, ExceptionState& exceptionState)
17 { 18 {
18 if (propertyName.isEmpty()) { 19 if (propertyName.isEmpty()) {
19 exceptionState.throwTypeError("Property name cannot be empty"); 20 exceptionState.throwTypeError("Property name cannot be empty");
20 return ScriptValue::createNull(scriptState); 21 return ScriptValue::createNull(scriptState);
21 } 22 }
22 23
23 CSSPropertyID propertyID = cssPropertyID(propertyName); 24 CSSPropertyID propertyID = cssPropertyID(propertyName);
24 // TODO(timloh): Handle custom properties 25 // TODO(timloh): Handle custom properties
(...skipping 14 matching lines...) Expand all
39 if (styleValueVector.size() != 1) { 40 if (styleValueVector.size() != 1) {
40 // TODO(meade): Support returning a CSSStyleValueOrCSSStyleValueSequence 41 // TODO(meade): Support returning a CSSStyleValueOrCSSStyleValueSequence
41 // from this function. 42 // from this function.
42 return ScriptValue::createNull(scriptState); 43 return ScriptValue::createNull(scriptState);
43 } 44 }
44 45
45 v8::Local<v8::Value> wrappedValue = toV8(styleValueVector[0], scriptState->c ontext()->Global(), scriptState->isolate()); 46 v8::Local<v8::Value> wrappedValue = toV8(styleValueVector[0], scriptState->c ontext()->Global(), scriptState->isolate());
46 return ScriptValue(scriptState, wrappedValue); 47 return ScriptValue(scriptState, wrappedValue);
47 } 48 }
48 49
50 } // namespace cssom
49 } // namespace blink 51 } // namespace blink
52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698