OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CSSStringValue_h | |
6 #define CSSStringValue_h | |
7 | |
8 #include "core/CoreExport.h" | |
9 #include "core/css/CSSValue.h" | |
10 #include "wtf/PassRefPtr.h" | |
11 #include "wtf/RefCounted.h" | |
12 #include "wtf/text/WTFString.h" | |
13 | |
14 namespace blink { | |
15 | |
16 class CORE_EXPORT CSSStringValue : public CSSValue { | |
17 public: | |
18 enum SerializationType { SerializeAsString, SerializeAsCustomIdentifier, Ser ializeAsURI }; | |
19 | |
20 static PassRefPtrWillBeRawPtr<CSSStringValue> create(const String& str, Seri alizationType serializationType) | |
21 { | |
22 return adoptRefWillBeNoop(new CSSStringValue(str, serializationType)); | |
23 } | |
24 | |
25 ~CSSStringValue(); | |
26 | |
27 String getStringValue() const { return m_string; } | |
28 SerializationType serializationType() const { return m_serializationType; } | |
29 | |
30 String customCSSText() const; | |
31 | |
32 bool equals(const CSSStringValue& other) const | |
33 { | |
34 return m_serializationType == other.m_serializationType | |
35 && equal(m_string, other.m_string); | |
36 } | |
37 | |
38 DECLARE_TRACE_AFTER_DISPATCH(); | |
39 | |
40 private: | |
41 CSSStringValue(const String& str, SerializationType serializationType) | |
42 : CSSValue(StringClass) | |
43 , m_string(str.impl()) | |
44 , m_serializationType(serializationType) | |
45 { | |
46 if (m_string) | |
47 m_string->ref(); | |
48 } | |
49 | |
50 StringImpl* m_string; | |
Timothy Loh
2015/08/31 06:32:47
..just store a String :\
| |
51 SerializationType m_serializationType; | |
52 }; | |
53 | |
54 DEFINE_CSS_VALUE_TYPE_CASTS(CSSStringValue, isStringValue()); | |
55 | |
56 } // namespace | |
57 | |
58 #endif // CSSStringValue_h | |
OLD | NEW |