summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSCursorImageValue.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/css/CSSCursorImageValue.h')
-rw-r--r--Source/WebCore/css/CSSCursorImageValue.h41
1 files changed, 14 insertions, 27 deletions
diff --git a/Source/WebCore/css/CSSCursorImageValue.h b/Source/WebCore/css/CSSCursorImageValue.h
index b1c6d1dee..d2da62df2 100644
--- a/Source/WebCore/css/CSSCursorImageValue.h
+++ b/Source/WebCore/css/CSSCursorImageValue.h
@@ -18,8 +18,7 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef CSSCursorImageValue_h
-#define CSSCursorImageValue_h
+#pragma once
#include "CSSImageValue.h"
#include "IntPoint.h"
@@ -29,13 +28,14 @@ namespace WebCore {
class Document;
class Element;
+class SVGCursorElement;
class SVGElement;
-class CSSCursorImageValue : public CSSValue {
+class CSSCursorImageValue final : public CSSValue {
public:
- static PassRef<CSSCursorImageValue> create(PassRef<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot)
+ static Ref<CSSCursorImageValue> create(Ref<CSSValue>&& imageValue, bool hasHotSpot, const IntPoint& hotSpot)
{
- return adoptRef(*new CSSCursorImageValue(std::move(imageValue), hasHotSpot, hotSpot));
+ return adoptRef(*new CSSCursorImageValue(WTFMove(imageValue), hasHotSpot, hotSpot));
}
~CSSCursorImageValue();
@@ -51,41 +51,28 @@ public:
String customCSSText() const;
- bool updateIfSVGCursorIsUsed(Element*);
- StyleImage* cachedImage(CachedResourceLoader*);
- StyleImage* cachedOrPendingImage(Document&);
+ std::pair<CachedImage*, float> loadImage(CachedResourceLoader&, const ResourceLoaderOptions&);
-#if ENABLE(SVG)
void removeReferencedElement(SVGElement*);
-#endif
bool equals(const CSSCursorImageValue&) const;
-private:
- CSSCursorImageValue(PassRef<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);
+ void cursorElementRemoved(SVGCursorElement&);
+ void cursorElementChanged(SVGCursorElement&);
- void detachPendingImage();
+private:
+ CSSCursorImageValue(Ref<CSSValue>&& imageValue, bool hasHotSpot, const IntPoint& hotSpot);
-#if ENABLE(SVG)
- bool isSVGCursor() const;
- String cachedImageURL();
- void clearCachedImage();
-#endif
+ SVGCursorElement* updateCursorElement(const Document&);
+ URL m_originalURL;
Ref<CSSValue> m_imageValue;
bool m_hasHotSpot;
IntPoint m_hotSpot;
- RefPtr<StyleImage> m_image;
- bool m_accessedImage;
-
-#if ENABLE(SVG)
- HashSet<SVGElement*> m_referencedElements;
-#endif
+ HashSet<SVGCursorElement*> m_cursorElements;
};
-CSS_VALUE_TYPE_CASTS(CSSCursorImageValue, isCursorImageValue())
-
} // namespace WebCore
-#endif // CSSCursorImageValue_h
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSCursorImageValue, isCursorImageValue())