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