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 CSSCustomIdentValue_h | 5 #ifndef CSSCustomIdentValue_h |
6 #define CSSCustomIdentValue_h | 6 #define CSSCustomIdentValue_h |
7 | 7 |
8 #include "core/CSSPropertyNames.h" | 8 #include "core/CSSPropertyNames.h" |
9 #include "core/css/CSSValue.h" | 9 #include "core/css/CSSValue.h" |
10 #include "wtf/PassRefPtr.h" | 10 #include "wtf/PassRefPtr.h" |
11 #include "wtf/RefCounted.h" | 11 #include "wtf/RefCounted.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class CSSCustomIdentValue : public CSSValue { | 15 class CSSCustomIdentValue : public CSSValue { |
16 public: | 16 public: |
17 static RawPtr<CSSCustomIdentValue> create(const String& str) | 17 static CSSCustomIdentValue* create(const String& str) |
18 { | 18 { |
19 return new CSSCustomIdentValue(str); | 19 return new CSSCustomIdentValue(str); |
20 } | 20 } |
21 | 21 |
22 // TODO(sashab, timloh): Remove this and lazily parse the CSSPropertyID in i
sKnownPropertyID(). | 22 // TODO(sashab, timloh): Remove this and lazily parse the CSSPropertyID in i
sKnownPropertyID(). |
23 static RawPtr<CSSCustomIdentValue> create(CSSPropertyID id) | 23 static CSSCustomIdentValue* create(CSSPropertyID id) |
24 { | 24 { |
25 return new CSSCustomIdentValue(id); | 25 return new CSSCustomIdentValue(id); |
26 } | 26 } |
27 | 27 |
28 String value() const { ASSERT(!isKnownPropertyID()); return m_string; } | 28 String value() const { ASSERT(!isKnownPropertyID()); return m_string; } |
29 bool isKnownPropertyID() const { return m_propertyId != CSSPropertyInvalid;
} | 29 bool isKnownPropertyID() const { return m_propertyId != CSSPropertyInvalid;
} |
30 CSSPropertyID valueAsPropertyID() const { ASSERT(isKnownPropertyID()); retur
n m_propertyId; } | 30 CSSPropertyID valueAsPropertyID() const { ASSERT(isKnownPropertyID()); retur
n m_propertyId; } |
31 | 31 |
32 String customCSSText() const; | 32 String customCSSText() const; |
33 | 33 |
(...skipping 11 matching lines...) Expand all Loading... |
45 // TODO(sashab): Change this to an AtomicString. | 45 // TODO(sashab): Change this to an AtomicString. |
46 String m_string; | 46 String m_string; |
47 CSSPropertyID m_propertyId; | 47 CSSPropertyID m_propertyId; |
48 }; | 48 }; |
49 | 49 |
50 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCustomIdentValue, isCustomIdentValue()); | 50 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCustomIdentValue, isCustomIdentValue()); |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // CSSCustomIdentValue_h | 54 #endif // CSSCustomIdentValue_h |
OLD | NEW |