| OLD | NEW |
| 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 #ifndef CSSStyleValue_h | 5 #ifndef CSSStyleValue_h |
| 6 #define CSSStyleValue_h | 6 #define CSSStyleValue_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "core/css/CSSValue.h" | 10 #include "core/css/CSSValue.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class ExceptionState; | 14 class ExceptionState; |
| 15 class ScriptState; | 15 class ScriptState; |
| 16 class ScriptValue; | 16 class ScriptValue; |
| 17 | 17 |
| 18 class CORE_EXPORT CSSStyleValue : public GarbageCollectedFinalized<CSSStyleValue
>, public ScriptWrappable { | 18 class CORE_EXPORT CSSStyleValue : public GarbageCollectedFinalized<CSSStyleValue
>, public ScriptWrappable { |
| 19 WTF_MAKE_NONCOPYABLE(CSSStyleValue); | 19 WTF_MAKE_NONCOPYABLE(CSSStyleValue); |
| 20 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 21 public: | 21 public: |
| 22 enum StyleValueType { | 22 enum StyleValueType { |
| 23 AngleType, | 23 AngleType, |
| 24 CalcLengthType, | 24 CalcLengthType, |
| 25 KeywordType, | 25 KeywordType, |
| 26 NumberType, | 26 NumberType, |
| 27 PositionType, | 27 PositionType, |
| 28 SimpleLengthType, | 28 SimpleLengthType, |
| 29 TransformValueType, | 29 TransformType, |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 virtual ~CSSStyleValue() { } | 32 virtual ~CSSStyleValue() { } |
| 33 | 33 |
| 34 virtual StyleValueType type() const = 0; | 34 virtual StyleValueType type() const = 0; |
| 35 | 35 |
| 36 static ScriptValue parse(ScriptState*, const String& propertyName, const Str
ing& value, ExceptionState&); | 36 static ScriptValue parse(ScriptState*, const String& propertyName, const Str
ing& value, ExceptionState&); |
| 37 | 37 |
| 38 virtual CSSValue* toCSSValue() const = 0; | 38 virtual CSSValue* toCSSValue() const = 0; |
| 39 virtual String cssString() const | 39 virtual String cssString() const |
| 40 { | 40 { |
| 41 return toCSSValue()->cssText(); | 41 return toCSSValue()->cssText(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 DEFINE_INLINE_VIRTUAL_TRACE() { } | 44 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 CSSStyleValue() {} | 47 CSSStyleValue() {} |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| 51 | 51 |
| 52 #endif | 52 #endif |
| OLD | NEW |