#ifndef ElementStyleResources_h
#define ElementStyleResources_h
#include "CSSPropertyNames.h"
#include "heap/Handle.h"
#include "platform/graphics/Color.h"
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
namespace WebCore {
class CSSCursorImageValue;
class CSSImageValue;
class CSSImageGeneratorValue;
class CSSImageSetValue;
class CSSSVGDocumentValue;
class CSSValue;
class FilterOperation;
class StyleImage;
class TextLinkColors;
typedef WillBeHeapHashMap<FilterOperation*, RefPtrWillBeMember<CSSSVGDocumentValue> > PendingSVGDocumentMap;
typedef WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<CSSValue> > PendingImagePropertyMap;
class ElementStyleResources {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(ElementStyleResources);
public:
ElementStyleResources();
PassRefPtr<StyleImage> styleImage(const TextLinkColors&, Color currentColor, CSSPropertyID, CSSValue*);
PassRefPtr<StyleImage> generatedOrPendingFromValue(CSSPropertyID, CSSImageGeneratorValue*);
PassRefPtr<StyleImage> cachedOrPendingFromValue(CSSPropertyID, CSSImageValue*);
PassRefPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, CSSImageSetValue*);
PassRefPtr<StyleImage> cursorOrPendingFromValue(CSSPropertyID, CSSCursorImageValue*);
const PendingImagePropertyMap& pendingImageProperties() const { return m_pendingImageProperties; }
const PendingSVGDocumentMap& pendingSVGDocuments() const { return m_pendingSVGDocuments; }
void clearPendingImageProperties();
void clearPendingSVGDocuments();
float deviceScaleFactor() const { return m_deviceScaleFactor; }
void setDeviceScaleFactor(float deviceScaleFactor) { m_deviceScaleFactor = deviceScaleFactor; }
void addPendingSVGDocument(FilterOperation*, CSSSVGDocumentValue*);
private:
PendingImagePropertyMap m_pendingImageProperties;
PendingSVGDocumentMap m_pendingSVGDocuments;
float m_deviceScaleFactor;
};
}
#endif