#pragma once
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/WeakPtr.h>
namespace WebCore {
class Document;
class HTMLStyleElement;
class Node;
class ShadowRoot;
class StyleSheet;
class CSSStyleSheet;
class StyleSheetList final : public RefCounted<StyleSheetList> {
public:
static Ref<StyleSheetList> create(Document& document) { return adoptRef(*new StyleSheetList(document)); }
static Ref<StyleSheetList> create(ShadowRoot& shadowRoot) { return adoptRef(*new StyleSheetList(shadowRoot)); }
WEBCORE_EXPORT ~StyleSheetList();
WEBCORE_EXPORT unsigned length() const;
WEBCORE_EXPORT StyleSheet* item(unsigned index);
CSSStyleSheet* namedItem(const AtomString&) const;
Vector<AtomString> supportedPropertyNames();
Node* ownerNode() const;
void detach();
private:
StyleSheetList(Document&);
StyleSheetList(ShadowRoot&);
const Vector<RefPtr<StyleSheet>>& styleSheets() const;
WeakPtr<Document> m_document;
ShadowRoot* m_shadowRoot { nullptr };
Vector<RefPtr<StyleSheet>> m_detachedStyleSheets;
};
}