CSSVariableDependentValue.h [plain text]
#ifndef CSSVariableDependentValue_h
#define CSSVariableDependentValue_h
#include "CSSPropertyNames.h"
#include "CSSValueList.h"
#include <wtf/RefPtr.h>
namespace WebCore {
class CSSVariableDependentValue : public CSSValue {
public:
static Ref<CSSVariableDependentValue> create(Ref<CSSValueList>&& valueList, CSSPropertyID propId)
{
return adoptRef(*new CSSVariableDependentValue(WTFMove(valueList), propId));
}
String customCSSText() const
{
if (!m_serialized) {
m_serialized = true;
m_stringValue = m_valueList->customCSSText();
}
return m_stringValue;
}
bool equals(const CSSVariableDependentValue& other) const { return customCSSText() == other.customCSSText(); }
CSSPropertyID propertyID() const { return m_propertyID; }
CSSValueList& valueList() { return m_valueList.get(); }
const CSSValueList& valueList() const { return m_valueList.get(); }
bool checkVariablesForCycles(const AtomicString& name, CustomPropertyValueMap& customProperties, const HashSet<AtomicString>& seenProperties, HashSet<AtomicString>& invalidProperties);
private:
CSSVariableDependentValue(Ref<CSSValueList>&& valueList, CSSPropertyID propId)
: CSSValue(VariableDependentClass)
, m_valueList(WTFMove(valueList))
, m_propertyID(propId)
{
}
Ref<CSSValueList> m_valueList;
CSSPropertyID m_propertyID;
mutable String m_stringValue;
mutable bool m_serialized { false };
};
}
SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSVariableDependentValue, isVariableDependentValue())
#endif // CSSCustomPropertyValue_h