#define CSSValue_h
#include "core/dom/ExceptionCode.h"
+#include "heap/Handle.h"
#include "platform/weborigin/KURL.h"
#include "wtf/HashMap.h"
#include "wtf/ListHashSet.h"
// They should be handled by separate wrapper classes.
// Please don't expose more CSSValue types to the web.
-class CSSValue : public RefCounted<CSSValue> {
+class CSSValue : public RefCountedWillBeRefCountedGarbageCollected<CSSValue> {
+ DECLARE_GC_INFO;
public:
enum Type {
CSS_INHERIT = 0,
// Override RefCounted's deref() to ensure operator delete is called on
// the appropriate subclass type.
+ // When oilpan is enabled the finalize method is called by the garbage
+ // collector and not immediately when deref reached zero.
+#if !ENABLE(OILPAN)
void deref()
{
if (derefBase())
destroy();
}
+#endif // !ENABLE(OILPAN)
Type cssValueType() const;
String cssText() const;
void setCSSText(const String&, ExceptionState&) { } // FIXME: Not implemented.
- String serializeResolvingVariables(const HashMap<AtomicString, String>&) const;
bool isPrimitiveValue() const { return m_classType == PrimitiveClass; }
bool isValueList() const { return m_classType >= ValueListClass; }
bool isCalcValue() const {return m_classType == CalculationClass; }
bool isFilterValue() const { return m_classType == CSSFilterClass; }
bool isArrayFunctionValue() const { return m_classType == CSSArrayFunctionValueClass; }
- bool isVariableValue() const { return m_classType == VariableClass; }
- bool isGridTemplateValue() const { return m_classType == GridTemplateClass; }
+ bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAreasClass; }
bool isSVGColor() const { return m_classType == SVGColorClass || m_classType == SVGPaintClass; }
bool isSVGPaint() const { return m_classType == SVGPaintClass; }
bool isSVGDocumentValue() const { return m_classType == CSSSVGDocumentClass; }
bool equals(const CSSValue&) const;
+ void finalize();
+ void traceAfterDispatch(Visitor*) { }
+ void trace(Visitor*);
+
protected:
static const size_t ClassTypeBits = 6;
UnicodeRangeClass,
LineBoxContainClass,
CalculationClass,
- VariableClass,
- GridTemplateClass,
+ GridTemplateAreasClass,
// SVG classes.
SVGColorClass,
return first ? second && first->equals(*second) : !second;
}
+template<typename CSSValueType>
+inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<CSSValueType>& second)
+{
+ return first ? second && first->equals(*second) : !second;
+}
+
+template<typename CSSValueType>
+inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<CSSValueType>& second)
+{
+ return first ? second && first->equals(*second) : !second;
+}
+
#define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predicate)