#ifndef StylePendingImage_h
#define StylePendingImage_h
#include "core/css/CSSCursorImageValue.h"
#include "core/css/CSSImageGeneratorValue.h"
#include "core/css/CSSImageSetValue.h"
#include "core/css/CSSImageValue.h"
#include "core/rendering/style/StyleImage.h"
#include "platform/graphics/Image.h"
namespace WebCore {
class StylePendingImage FINAL : public StyleImage {
public:
static PassRefPtr<StylePendingImage> create(CSSValue* value) { return adoptRef(new StylePendingImage(value)); }
virtual WrappedImagePtr data() const OVERRIDE { return m_value; }
virtual PassRefPtrWillBeRawPtr<CSSValue> cssValue() const OVERRIDE { return m_value; }
CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? toCSSImageValue(m_value) : 0; }
CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? toCSSImageGeneratorValue(m_value) : 0; }
CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? toCSSCursorImageValue(m_value) : 0; }
CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? toCSSImageSetValue(m_value) : 0; }
virtual LayoutSize imageSize(const RenderObject*, float ) const OVERRIDE { return LayoutSize(); }
virtual bool imageHasRelativeWidth() const OVERRIDE { return false; }
virtual bool imageHasRelativeHeight() const OVERRIDE { return false; }
virtual void computeIntrinsicDimensions(const RenderObject*, Length& , Length& , FloatSize& ) OVERRIDE { }
virtual bool usesImageContainerSize() const OVERRIDE { return false; }
virtual void setContainerSizeForRenderer(const RenderObject*, const IntSize&, float) OVERRIDE { }
virtual void addClient(RenderObject*) OVERRIDE { }
virtual void removeClient(RenderObject*) OVERRIDE { }
virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const OVERRIDE
{
ASSERT_NOT_REACHED();
return nullptr;
}
virtual bool knownToBeOpaque(const RenderObject*) const OVERRIDE { return false; }
private:
StylePendingImage(CSSValue* value)
: m_value(value)
{
m_isPendingImage = true;
}
CSSValue* m_value;
};
DEFINE_STYLE_IMAGE_TYPE_CASTS(StylePendingImage, isPendingImage());
}
#endif