HTMLFormControlsCollection.h [plain text]
#pragma once
#include "CachedHTMLCollection.h"
#include "HTMLFormElement.h"
#include "RadioNodeList.h"
namespace WebCore {
class FormAssociatedElement;
class HTMLImageElement;
class HTMLFormControlsCollection final : public CachedHTMLCollection<HTMLFormControlsCollection, CollectionTypeTraits<FormControls>::traversalType> {
WTF_MAKE_ISO_ALLOCATED(HTMLFormControlsCollection);
public:
static Ref<HTMLFormControlsCollection> create(ContainerNode&, CollectionType);
virtual ~HTMLFormControlsCollection();
HTMLElement* item(unsigned offset) const override;
Optional<Variant<RefPtr<RadioNodeList>, RefPtr<Element>>> namedItemOrItems(const String&) const;
HTMLFormElement& ownerNode() const;
HTMLElement* customElementAfter(Element*) const;
private:
explicit HTMLFormControlsCollection(ContainerNode&);
void invalidateCacheForDocument(Document&) override;
void updateNamedElementCache() const override;
mutable Element* m_cachedElement;
mutable unsigned m_cachedElementOffsetInArray;
};
inline HTMLElement* HTMLFormControlsCollection::item(unsigned offset) const
{
return downcast<HTMLElement>(CachedHTMLCollection::item(offset));
}
}
SPECIALIZE_TYPE_TRAITS_HTMLCOLLECTION(HTMLFormControlsCollection, FormControls)