#ifndef StyleElement_h
#define StyleElement_h
#include "CSSStyleSheet.h"
namespace WebCore {
class Document;
class Element;
class StyleElement {
public:
StyleElement(Document*, bool createdByParser);
virtual ~StyleElement();
protected:
virtual const AtomicString& type() const = 0;
virtual const AtomicString& media() const = 0;
StyleSheet* sheet() const { return m_sheet.get(); }
bool isLoading() const;
bool sheetLoaded(Document*);
void insertedIntoDocument(Document*, Element*);
void removedFromDocument(Document*, Element*);
void clearDocumentData(Document*, Element*);
void childrenChanged(Element*);
void finishParsingChildren(Element*);
RefPtr<CSSStyleSheet> m_sheet;
private:
void createSheet(Element*, int startLineNumber, const String& text = String());
void process(Element*);
bool m_createdByParser;
bool m_loading;
int m_startLineNumber;
};
}
#endif