Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Unified Diff: Source/core/html/HTMLOptionsCollection.h

Issue 485093003: Make it obvious an HTMLOptionsCollection can only contain HTMLOptionElements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/HTMLCollection.cpp ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLOptionsCollection.h
diff --git a/Source/core/html/HTMLOptionsCollection.h b/Source/core/html/HTMLOptionsCollection.h
index 1e88218bcfaaf5a5f152e8917f7acf98f46f5464..d2d379bc2c63b57e0b6a381e6ced990fc3d67309 100644
--- a/Source/core/html/HTMLOptionsCollection.h
+++ b/Source/core/html/HTMLOptionsCollection.h
@@ -25,17 +25,18 @@
#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 {
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 +48,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 +58,11 @@ private:
DEFINE_TYPE_CASTS(HTMLOptionsCollection, LiveNodeListBase, collection, collection->type() == SelectOptions, collection.type() == SelectOptions);
+inline bool HTMLOptionsCollection::elementMatches(const HTMLElement& element) const
+{
+ return isHTMLOptionElement(element);
+}
+
} //namespace
#endif
« no previous file with comments | « Source/core/html/HTMLCollection.cpp ('k') | Source/core/html/HTMLSelectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698