Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLOptionsCollection.h
index 1e88218..2b95a83 100644 (file)
 #define HTMLOptionsCollection_h
 
 #include "core/html/HTMLCollection.h"
+#include "core/html/HTMLOptionElement.h"
 
 namespace blink {
 
 class ExceptionState;
-class HTMLOptionElement;
-class HTMLSelectElement;
 
 class HTMLOptionsCollection FINAL : public HTMLCollection {
+    DEFINE_WRAPPERTYPEINFO();
 public:
     static PassRefPtrWillBeRawPtr<HTMLOptionsCollection> create(ContainerNode&, CollectionType);
 
+    HTMLOptionElement* item(unsigned offset) const { return toHTMLOptionElement(HTMLCollection::item(offset)); }
+
     void add(PassRefPtrWillBeRawPtr<HTMLOptionElement>, ExceptionState&);
     void add(PassRefPtrWillBeRawPtr<HTMLOptionElement>, int index, ExceptionState&);
     void remove(int index);
@@ -47,6 +49,8 @@ public:
     void namedGetter(const AtomicString& name, RefPtrWillBeRawPtr<NodeList>&, RefPtrWillBeRawPtr<Element>&);
     bool anonymousIndexedSetter(unsigned, PassRefPtrWillBeRawPtr<HTMLOptionElement>, ExceptionState&);
 
+    bool elementMatches(const HTMLElement&) const;
+
 private:
     explicit HTMLOptionsCollection(ContainerNode&);
 
@@ -55,6 +59,11 @@ private:
 
 DEFINE_TYPE_CASTS(HTMLOptionsCollection, LiveNodeListBase, collection, collection->type() == SelectOptions, collection.type() == SelectOptions);
 
-} //namespace
+inline bool HTMLOptionsCollection::elementMatches(const HTMLElement& element) const
+{
+    return isHTMLOptionElement(element);
+}
+
+} // namespace blink
 
-#endif
+#endif // HTMLOptionsCollection_h