Index: third_party/WebKit/Source/core/css/CSSCustomIdentValue.h |
diff --git a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h |
index 71f5dabf926ad664c1fa1cb8caa44b1d731a3378..6383341ce991788d4b53067c80b267db0c17d85e 100644 |
--- a/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h |
+++ b/third_party/WebKit/Source/core/css/CSSCustomIdentValue.h |
@@ -5,6 +5,7 @@ |
#ifndef CSSCustomIdentValue_h |
#define CSSCustomIdentValue_h |
+#include "core/CSSPropertyNames.h" |
#include "core/CoreExport.h" |
#include "core/css/CSSValue.h" |
#include "wtf/PassRefPtr.h" |
@@ -19,21 +20,33 @@ public: |
return adoptRefWillBeNoop(new CSSCustomIdentValue(str)); |
} |
- String value() const { return m_string; } |
+ // TODO(sashab, timloh): Remove this and move all parsing logic into the |
+ // create(String) method. |
alancutter (OOO until 2018)
2015/10/07 02:05:10
We won't want to convert to CSSPropertyIDs in ever
sashab
2015/10/07 02:21:02
Ahh yes, you're right. Thanks; done.
|
+ static PassRefPtrWillBeRawPtr<CSSCustomIdentValue> create(CSSPropertyID id) |
+ { |
+ return adoptRefWillBeNoop(new CSSCustomIdentValue(id)); |
+ } |
+ |
+ String value() const { ASSERT(!isKnownPropertyID()); return m_string; } |
+ bool isKnownPropertyID() const { return m_propertyId != CSSPropertyInvalid; } |
+ CSSPropertyID valueAsPropertyID() const { ASSERT(isKnownPropertyID()); return m_propertyId; } |
String customCSSText() const; |
bool equals(const CSSCustomIdentValue& other) const |
{ |
- return m_string == other.m_string; |
+ return isKnownPropertyID() ? m_propertyId == other.m_propertyId : m_string == other.m_string; |
} |
DECLARE_TRACE_AFTER_DISPATCH(); |
private: |
CSSCustomIdentValue(const String&); |
+ CSSCustomIdentValue(CSSPropertyID); |
+ // TODO(sashab): Change this to an AtomicString. |
String m_string; |
+ CSSPropertyID m_propertyId; |
}; |
DEFINE_CSS_VALUE_TYPE_CASTS(CSSCustomIdentValue, isCustomIdentValue()); |