summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSImageValue.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/CSSImageValue.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/WebCore/css/CSSImageValue.h')
-rw-r--r--Source/WebCore/css/CSSImageValue.h43
1 files changed, 19 insertions, 24 deletions
diff --git a/Source/WebCore/css/CSSImageValue.h b/Source/WebCore/css/CSSImageValue.h
index 9cc8bc3e4..48581945b 100644
--- a/Source/WebCore/css/CSSImageValue.h
+++ b/Source/WebCore/css/CSSImageValue.h
@@ -18,39 +18,37 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef CSSImageValue_h
-#define CSSImageValue_h
+#pragma once
#include "CSSValue.h"
-#include <wtf/RefPtr.h>
+#include "CachedResourceHandle.h"
+#include <wtf/Ref.h>
namespace WebCore {
+class CachedImage;
class CachedResourceLoader;
-class Element;
-class StyleCachedImage;
-class StyleImage;
+class DeprecatedCSSOMValue;
class RenderElement;
struct ResourceLoaderOptions;
-class CSSImageValue : public CSSValue {
+class CSSImageValue final : public CSSValue {
public:
- static PassRef<CSSImageValue> create(const String& url) { return adoptRef(*new CSSImageValue(url)); }
- static PassRef<CSSImageValue> create(const String& url, StyleImage* image) { return adoptRef(*new CSSImageValue(url, image)); }
+ static Ref<CSSImageValue> create(URL&& url) { return adoptRef(*new CSSImageValue(WTFMove(url))); }
+ static Ref<CSSImageValue> create(CachedImage& image) { return adoptRef(*new CSSImageValue(image)); }
~CSSImageValue();
- StyleCachedImage* cachedImage(CachedResourceLoader*, const ResourceLoaderOptions&);
- StyleCachedImage* cachedImage(CachedResourceLoader*);
- // Returns a StyleCachedImage if the image is cached already, otherwise a StylePendingImage.
- StyleImage* cachedOrPendingImage();
+ bool isPending() const;
+ CachedImage* loadImage(CachedResourceLoader&, const ResourceLoaderOptions&);
+ CachedImage* cachedImage() const { return m_cachedImage.get(); }
- const String& url() const { return m_url; }
+ const URL& url() const { return m_url; }
String customCSSText() const;
- PassRefPtr<CSSValue> cloneForCSSOM() const;
+ Ref<DeprecatedCSSOMValue> createDeprecatedCSSOMWrapper() const;
- bool hasFailedOrCanceledSubresources() const;
+ bool traverseSubresources(const std::function<bool (const CachedResource&)>& handler) const;
bool equals(const CSSImageValue&) const;
@@ -59,18 +57,15 @@ public:
void setInitiator(const AtomicString& name) { m_initiatorName = name; }
private:
- explicit CSSImageValue(const String& url);
- CSSImageValue(const String& url, StyleImage*);
- void detachPendingImage();
+ explicit CSSImageValue(URL&&);
+ explicit CSSImageValue(CachedImage&);
- String m_url;
- RefPtr<StyleImage> m_image;
+ URL m_url;
+ CachedResourceHandle<CachedImage> m_cachedImage;
bool m_accessedImage;
AtomicString m_initiatorName;
};
-CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue())
-
} // namespace WebCore
-#endif // CSSImageValue_h
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSImageValue, isImageValue())