#ifndef StyleSheetList_h
#define StyleSheetList_h
#include "core/css/CSSStyleSheet.h"
#include "core/dom/TreeScope.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/Vector.h"
namespace WebCore {
class HTMLStyleElement;
class StyleSheet;
class StyleSheetList : public RefCountedWillBeGarbageCollectedFinalized<StyleSheetList> {
public:
static PassRefPtrWillBeRawPtr<StyleSheetList> create(TreeScope* treeScope) { return adoptRefWillBeNoop(new StyleSheetList(treeScope)); }
~StyleSheetList();
unsigned length();
StyleSheet* item(unsigned index);
HTMLStyleElement* getNamedItem(const AtomicString&) const;
Document* document() { return m_treeScope ? &m_treeScope->document() : 0; }
void detachFromDocument();
CSSStyleSheet* anonymousNamedGetter(const AtomicString&);
void trace(Visitor*);
private:
StyleSheetList(TreeScope*);
const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheets();
TreeScope* m_treeScope;
WillBeHeapVector<RefPtrWillBeMember<StyleSheet> > m_detachedStyleSheets;
};
}
#endif