HTMLStyleElement.h [plain text]
#pragma once
#include "HTMLElement.h"
#include "InlineStyleSheetOwner.h"
namespace WebCore {
class HTMLStyleElement;
class StyleSheet;
template<typename T> class EventSender;
using StyleEventSender = EventSender<HTMLStyleElement>;
class HTMLStyleElement final : public HTMLElement {
WTF_MAKE_ISO_ALLOCATED(HTMLStyleElement);
public:
static Ref<HTMLStyleElement> create(Document&);
static Ref<HTMLStyleElement> create(const QualifiedName&, Document&, bool createdByParser);
virtual ~HTMLStyleElement();
CSSStyleSheet* sheet() const { return m_styleSheetOwner.sheet(); }
WEBCORE_EXPORT bool disabled() const;
WEBCORE_EXPORT void setDisabled(bool);
void dispatchPendingEvent(StyleEventSender*);
static void dispatchPendingLoadEvents();
void finishParsingChildren() final;
private:
HTMLStyleElement(const QualifiedName&, Document&, bool createdByParser);
void parseAttribute(const QualifiedName&, const AtomicString&) final;
InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) final;
void removedFromAncestor(RemovalType, ContainerNode&) final;
void childrenChanged(const ChildChange&) final;
bool isLoading() const { return m_styleSheetOwner.isLoading(); }
bool sheetLoaded() final { return m_styleSheetOwner.sheetLoaded(*this); }
void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred) final;
void startLoadingDynamicSheet() final { m_styleSheetOwner.startLoadingDynamicSheet(*this); }
void addSubresourceAttributeURLs(ListHashSet<URL>&) const final;
InlineStyleSheetOwner m_styleSheetOwner;
bool m_firedLoad { false };
bool m_loadedSheet { false };
};
}