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 4eea95183f5fcfc83f799f3227ac35e413109928..df4cce19cd991a817b1d9a6fbf61bbc31c4e83c4 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/css/CSSValue.h" |
#include "wtf/PassRefPtr.h" |
#include "wtf/RefCounted.h" |
@@ -18,21 +19,32 @@ public: |
return adoptRefWillBeNoop(new CSSCustomIdentValue(str)); |
} |
- String value() const { return m_string; } |
+ // TODO(sashab, timloh): Remove this and lazily parse the CSSPropertyID in isKnownPropertyID(). |
+ 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()); |