summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLCollection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/HTMLCollection.cpp')
-rw-r--r--WebCore/html/HTMLCollection.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/WebCore/html/HTMLCollection.cpp b/WebCore/html/HTMLCollection.cpp
index de4c424..2b29589 100644
--- a/WebCore/html/HTMLCollection.cpp
+++ b/WebCore/html/HTMLCollection.cpp
@@ -27,6 +27,7 @@
#include "HTMLElement.h"
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
+#include "HTMLOptionElement.h"
#include "NodeList.h"
#include <utility>
@@ -104,6 +105,7 @@ Element* HTMLCollection::itemAfter(Element* previous) const
case MapAreas:
case OtherCollection:
case SelectOptions:
+ case DataListOptions:
case WindowNamedItems:
break;
case NodeChildren:
@@ -153,6 +155,13 @@ Element* HTMLCollection::itemAfter(Element* previous) const
if (e->hasLocalName(optionTag))
return e;
break;
+ case DataListOptions:
+ if (e->hasLocalName(optionTag)) {
+ HTMLOptionElement* option = static_cast<HTMLOptionElement*>(e);
+ if (!option->disabled() && !option->value().isEmpty())
+ return e;
+ }
+ break;
case MapAreas:
if (e->hasLocalName(areaTag))
return e;
@@ -242,15 +251,15 @@ Node* HTMLCollection::firstItem() const
Node* HTMLCollection::nextItem() const
{
resetCollectionInfo();
-
+
#ifdef ANDROID_FIX
- // resetCollectionInfo() can set info->current to be 0. If this is the
- // case, we need to go back to the firstItem. Otherwise traverseNextItem
+ // resetCollectionInfo() can set info->current to be 0. If this is the
+ // case, we need to go back to the firstItem. Otherwise traverseNextItem
// will crash.
if (!m_info->current)
return firstItem();
#endif
-
+
// Look for the 'second' item. The first one is currentItem, already given back.
Element* retval = itemAfter(m_info->current);
m_info->current = retval;