InlineStyleSheetOwner.h [plain text]
#ifndef InlineStyleSheetOwner_h
#define InlineStyleSheetOwner_h
#include "CSSStyleSheet.h"
#include <wtf/text/TextPosition.h>
namespace WebCore {
class Document;
class Element;
class InlineStyleSheetOwner {
public:
InlineStyleSheetOwner(Document&, bool createdByParser);
~InlineStyleSheetOwner();
void setContentType(const AtomicString& contentType) { m_contentType = contentType; }
void setMedia(const AtomicString& media) { m_media = media; }
CSSStyleSheet* sheet() const { return m_sheet.get(); }
bool isLoading() const;
bool sheetLoaded(Document&);
void startLoadingDynamicSheet(Document&);
void insertedIntoDocument(Document&, Element&);
void removedFromDocument(Document&, Element&);
void clearDocumentData(Document&, Element&);
void childrenChanged(Element&);
void finishParsingChildren(Element&);
private:
void createSheet(Element&, const String& text);
void createSheetFromTextContents(Element&);
void clearSheet();
bool m_isParsingChildren;
bool m_loading;
WTF::OrdinalNumber m_startLineNumber;
AtomicString m_contentType;
AtomicString m_media;
RefPtr<CSSStyleSheet> m_sheet;
};
}
#endif