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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSCustomIdentValue.cpp

Issue 1373433002: Split out CSSPrimitiveValue's PropertyID into CSSCustomIdentValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_string
Patch Set: Rebase Created 5 years, 2 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
OLDNEW
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 #include "config.h" 5 #include "config.h"
6 #include "core/css/CSSCustomIdentValue.h" 6 #include "core/css/CSSCustomIdentValue.h"
7 7
8 #include "core/css/CSSMarkup.h" 8 #include "core/css/CSSMarkup.h"
9 #include "wtf/text/WTFString.h" 9 #include "wtf/text/WTFString.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 CSSCustomIdentValue::CSSCustomIdentValue(const String& str) 13 CSSCustomIdentValue::CSSCustomIdentValue(const String& str)
14 : CSSValue(CustomIdentClass) 14 : CSSValue(CustomIdentClass)
15 , m_string(str) { } 15 , m_string(str)
16 , m_propertyId(CSSPropertyInvalid) { }
17
18 CSSCustomIdentValue::CSSCustomIdentValue(CSSPropertyID id)
19 : CSSValue(CustomIdentClass)
20 , m_string()
21 , m_propertyId(id)
22 {
23 ASSERT(isKnownPropertyID());
24 }
25
16 26
17 String CSSCustomIdentValue::customCSSText() const 27 String CSSCustomIdentValue::customCSSText() const
18 { 28 {
29 if (isKnownPropertyID())
30 return getPropertyNameAtomicString(m_propertyId);
19 return quoteCSSStringIfNeeded(m_string); 31 return quoteCSSStringIfNeeded(m_string);
20 } 32 }
21 33
22 DEFINE_TRACE_AFTER_DISPATCH(CSSCustomIdentValue) 34 DEFINE_TRACE_AFTER_DISPATCH(CSSCustomIdentValue)
23 { 35 {
24 CSSValue::traceAfterDispatch(visitor); 36 CSSValue::traceAfterDispatch(visitor);
25 } 37 }
26 38
27 } // namespace blink 39 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698