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

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

Issue 2903413002: Restructure type tracking in StyleValues to work better with new numeric types (Closed)
Patch Set: rebase Created 3 years, 6 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/ToV8ForCore.h" 9 #include "bindings/core/v8/ToV8ForCore.h"
10 #include "core/StylePropertyShorthand.h" 10 #include "core/StylePropertyShorthand.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // from this function. 46 // from this function.
47 return ScriptValue::CreateNull(script_state); 47 return ScriptValue::CreateNull(script_state);
48 } 48 }
49 49
50 v8::Local<v8::Value> wrapped_value = 50 v8::Local<v8::Value> wrapped_value =
51 ToV8(style_value_vector[0], script_state->GetContext()->Global(), 51 ToV8(style_value_vector[0], script_state->GetContext()->Global(),
52 script_state->GetIsolate()); 52 script_state->GetIsolate());
53 return ScriptValue(script_state, wrapped_value); 53 return ScriptValue(script_state, wrapped_value);
54 } 54 }
55 55
56 String CSSStyleValue::StyleValueTypeToString(StyleValueType type) {
57 switch (type) {
58 case StyleValueType::kNumberType:
59 return "number";
60 case StyleValueType::kPercentType:
61 return "percent";
62 case StyleValueType::kLengthType:
63 return "length";
64 case StyleValueType::kAngleType:
65 return "angle";
66 case StyleValueType::kTimeType:
67 return "time";
68 case StyleValueType::kFrequencyType:
69 return "frequency";
70 case StyleValueType::kResolutionType:
71 return "resolution";
72 case StyleValueType::kFlexType:
73 return "flex";
74 default:
75 NOTREACHED();
76 return "";
77 }
78 }
79
56 } // namespace blink 80 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/cssom/CSSStyleValue.h ('k') | third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698