diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/CSSCursorImageValue.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/css/CSSCursorImageValue.h')
-rw-r--r-- | Source/WebCore/css/CSSCursorImageValue.h | 41 |
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()) |