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 KeywordValue_h | 5 #ifndef KeywordValue_h |
6 #define KeywordValue_h | 6 #define KeywordValue_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/cssom/StyleValue.h" | 9 #include "core/css/cssom/StyleValue.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class ExceptionState; | 13 class ExceptionState; |
14 | 14 |
15 class CORE_EXPORT KeywordValue final : public StyleValue { | 15 class CORE_EXPORT KeywordValue final : public StyleValue { |
16 WTF_MAKE_NONCOPYABLE(KeywordValue); | 16 WTF_MAKE_NONCOPYABLE(KeywordValue); |
17 DEFINE_WRAPPERTYPEINFO(); | 17 DEFINE_WRAPPERTYPEINFO(); |
18 public: | 18 public: |
19 static KeywordValue* create(const String& keyword, ExceptionState&); | 19 static KeywordValue* create(const String& keyword, ExceptionState&); |
20 | 20 |
21 StyleValueType type() const override { return KeywordType; } | 21 StyleValueType type() const override { return KeywordType; } |
22 | 22 |
23 const String& keywordValue() const; | 23 const String& keywordValue() const; |
24 CSSValueID keywordValueID() const; | 24 CSSValueID keywordValueID() const; |
25 | 25 |
26 RawPtr<CSSValue> toCSSValue() const override; | 26 CSSValue* toCSSValue() const override; |
27 | 27 |
28 private: | 28 private: |
29 KeywordValue(const String& keyword) : m_keywordValue(keyword) {} | 29 KeywordValue(const String& keyword) : m_keywordValue(keyword) {} |
30 | 30 |
31 String m_keywordValue; | 31 String m_keywordValue; |
32 }; | 32 }; |
33 | 33 |
34 DEFINE_TYPE_CASTS(KeywordValue, StyleValue, value, | 34 DEFINE_TYPE_CASTS(KeywordValue, StyleValue, value, |
35 value->type() == StyleValue::StyleValueType::KeywordType, | 35 value->type() == StyleValue::StyleValueType::KeywordType, |
36 value.type() == StyleValue::StyleValueType::KeywordType); | 36 value.type() == StyleValue::StyleValueType::KeywordType); |
37 | 37 |
38 } // namespace blink | 38 } // namespace blink |
39 | 39 |
40 #endif | 40 #endif |
OLD | NEW |