#ifndef XSLImportRule_h
#define XSLImportRule_h
#include "RuntimeEnabledFeatures.h"
#include "core/fetch/ResourcePtr.h"
#include "core/fetch/StyleSheetResourceClient.h"
#include "core/xml/XSLStyleSheet.h"
#include "wtf/PassOwnPtr.h"
namespace WebCore {
class XSLStyleSheetResource;
class XSLImportRule FINAL : private StyleSheetResourceClient {
WTF_MAKE_FAST_ALLOCATED;
public:
static PassOwnPtr<XSLImportRule> create(XSLStyleSheet* parentSheet, const String& href)
{
ASSERT(RuntimeEnabledFeatures::xsltEnabled());
return adoptPtr(new XSLImportRule(parentSheet, href));
}
virtual ~XSLImportRule();
const String& href() const { return m_strHref; }
XSLStyleSheet* styleSheet() const { return m_styleSheet.get(); }
XSLStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; }
void setParentStyleSheet(XSLStyleSheet* styleSheet) { m_parentStyleSheet = styleSheet; }
bool isLoading();
void loadSheet();
private:
XSLImportRule(XSLStyleSheet* parentSheet, const String& href);
virtual void setXSLStyleSheet(const String& href, const KURL& baseURL, const String& sheet) OVERRIDE;
XSLStyleSheet* m_parentStyleSheet;
String m_strHref;
RefPtrWillBePersistent<XSLStyleSheet> m_styleSheet;
ResourcePtr<XSLStyleSheetResource> m_resource;
bool m_loading;
};
}
#endif