CSSCursorImageValue.h [plain text]
#ifndef CSSCursorImageValue_h
#define CSSCursorImageValue_h
#include "CSSImageValue.h"
#include "IntPoint.h"
#include <wtf/HashSet.h>
namespace WebCore {
class Document;
class Element;
class SVGElement;
class CSSCursorImageValue : public CSSValue {
public:
static Ref<CSSCursorImageValue> create(Ref<CSSValue>&& imageValue, bool hasHotSpot, const IntPoint& hotSpot)
{
return adoptRef(*new CSSCursorImageValue(WTF::move(imageValue), hasHotSpot, hotSpot));
}
~CSSCursorImageValue();
bool hasHotSpot() const { return m_hasHotSpot; }
IntPoint hotSpot() const
{
if (m_hasHotSpot)
return m_hotSpot;
return IntPoint(-1, -1);
}
String customCSSText() const;
bool updateIfSVGCursorIsUsed(Element*);
StyleImage* cachedImage(CachedResourceLoader&, const ResourceLoaderOptions&);
StyleImage* cachedOrPendingImage(Document&);
void removeReferencedElement(SVGElement*);
bool equals(const CSSCursorImageValue&) const;
private:
CSSCursorImageValue(Ref<CSSValue>&& imageValue, bool hasHotSpot, const IntPoint& hotSpot);
void detachPendingImage();
bool isSVGCursor() const;
String cachedImageURL();
void clearCachedImage();
Ref<CSSValue> m_imageValue;
bool m_hasHotSpot;
IntPoint m_hotSpot;
RefPtr<StyleImage> m_image;
bool m_accessedImage;
HashSet<SVGElement*> m_referencedElements;
};
}
SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCursorImageValue, isCursorImageValue())
#endif // CSSCursorImageValue_h