diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/html/HTMLFormControlsCollection.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/html/HTMLFormControlsCollection.h')
-rw-r--r-- | Source/WebCore/html/HTMLFormControlsCollection.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/Source/WebCore/html/HTMLFormControlsCollection.h b/Source/WebCore/html/HTMLFormControlsCollection.h index a4cfd2d18..dc166358e 100644 --- a/Source/WebCore/html/HTMLFormControlsCollection.h +++ b/Source/WebCore/html/HTMLFormControlsCollection.h @@ -20,43 +20,47 @@ * */ -#ifndef HTMLFormControlsCollection_h -#define HTMLFormControlsCollection_h +#pragma once -#include "HTMLCollection.h" +#include "CachedHTMLCollection.h" +#include "HTMLElement.h" namespace WebCore { class FormAssociatedElement; -class HTMLElement; class HTMLImageElement; -class QualifiedName; // This class is just a big hack to find form elements even in malformed HTML elements. // The famous <table><tr><form><td> problem. -class HTMLFormControlsCollection : public HTMLCollection { +class HTMLFormControlsCollection final : public CachedHTMLCollection<HTMLFormControlsCollection, CollectionTypeTraits<FormControls>::traversalType> { public: - static PassRefPtr<HTMLFormControlsCollection> create(ContainerNode&, CollectionType); - + static Ref<HTMLFormControlsCollection> create(ContainerNode&, CollectionType); virtual ~HTMLFormControlsCollection(); - virtual Node* namedItem(const AtomicString& name) const override; + HTMLElement* item(unsigned offset) const override; + + // For CachedHTMLCollection. + HTMLElement* customElementAfter(Element*) const; private: explicit HTMLFormControlsCollection(ContainerNode&); - virtual void invalidateCache() const override; - virtual void updateNameCache() const override; + void invalidateCache(Document&) override; + void updateNamedElementCache() const override; const Vector<FormAssociatedElement*>& formControlElements() const; const Vector<HTMLImageElement*>& formImageElements() const; - virtual Element* customElementAfter(Element*) const override; mutable Element* m_cachedElement; mutable unsigned m_cachedElementOffsetInArray; }; -} // namespace +inline HTMLElement* HTMLFormControlsCollection::item(unsigned offset) const +{ + return downcast<HTMLElement>(CachedHTMLCollection<HTMLFormControlsCollection, CollectionTypeTraits<FormControls>::traversalType>::item(offset)); +} + +} // namespace WebCore -#endif +SPECIALIZE_TYPE_TRAITS_HTMLCOLLECTION(HTMLFormControlsCollection, FormControls) |