HTMLStyleElement.h [plain text]
#ifndef HTMLStyleElement_h
#define HTMLStyleElement_h
#include "HTMLElement.h"
#include "StyleElement.h"
namespace WebCore {
class HTMLStyleElement;
class StyleSheet;
template<typename T> class EventSender;
typedef EventSender<HTMLStyleElement> StyleEventSender;
class HTMLStyleElement FINAL : public HTMLElement, private StyleElement {
public:
static PassRefPtr<HTMLStyleElement> create(const QualifiedName&, Document*, bool createdByParser);
virtual ~HTMLStyleElement();
void setType(const AtomicString&);
bool scoped() const;
void setScoped(bool);
Element* scopingElement() const;
bool isRegisteredAsScoped() const
{
if (m_scopedStyleRegistrationState == NotRegistered)
return false;
return true;
}
using StyleElement::sheet;
bool disabled() const;
void setDisabled(bool);
void dispatchPendingEvent(StyleEventSender*);
static void dispatchPendingLoadEvents();
private:
HTMLStyleElement(const QualifiedName&, Document*, bool createdByParser);
virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
virtual InsertionNotificationRequest insertedInto(ContainerNode*) OVERRIDE;
virtual void removedFrom(ContainerNode*) OVERRIDE;
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
virtual void finishParsingChildren();
virtual bool isLoading() const { return StyleElement::isLoading(); }
virtual bool sheetLoaded() { return StyleElement::sheetLoaded(document()); }
virtual void notifyLoadedSheetAndAllCriticalSubresources(bool errorOccurred);
virtual void startLoadingDynamicSheet() { StyleElement::startLoadingDynamicSheet(document()); }
virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const;
virtual const AtomicString& media() const;
virtual const AtomicString& type() const;
void scopedAttributeChanged(bool);
void registerWithScopingNode(bool);
void unregisterWithScopingNode(ContainerNode*);
bool m_firedLoad;
bool m_loadedSheet;
enum ScopedStyleRegistrationState {
NotRegistered,
RegisteredAsScoped,
RegisteredInShadowRoot
};
ScopedStyleRegistrationState m_scopedStyleRegistrationState;
};
}
#endif