Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: Source/core/css/CSSStringValue.h

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/css/CSSStringValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.cpp ('k') | Source/core/css/CSSStringValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698