Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLOptionsCollection.cpp
index e27e0e1..d1150f9 100644 (file)
 #include "config.h"
 #include "core/html/HTMLOptionsCollection.h"
 
-#include "bindings/v8/ExceptionMessages.h"
-#include "bindings/v8/ExceptionState.h"
+#include "bindings/core/v8/ExceptionMessages.h"
+#include "bindings/core/v8/ExceptionState.h"
 #include "core/dom/ExceptionCode.h"
-#include "core/dom/NamedNodesCollection.h"
+#include "core/dom/StaticNodeList.h"
 #include "core/html/HTMLOptionElement.h"
 #include "core/html/HTMLSelectElement.h"
 
-namespace WebCore {
+namespace blink {
 
 HTMLOptionsCollection::HTMLOptionsCollection(ContainerNode& select)
     : HTMLCollection(select, SelectOptions, DoesNotOverrideItemAfter)
@@ -103,11 +103,6 @@ void HTMLOptionsCollection::remove(int index)
     toHTMLSelectElement(ownerNode()).remove(index);
 }
 
-void HTMLOptionsCollection::remove(HTMLOptionElement* option)
-{
-    return remove(option->index());
-}
-
 int HTMLOptionsCollection::selectedIndex() const
 {
     return toHTMLSelectElement(ownerNode()).selectedIndex();
@@ -123,7 +118,7 @@ void HTMLOptionsCollection::setLength(unsigned length, ExceptionState& exception
     toHTMLSelectElement(ownerNode()).setLength(length, exceptionState);
 }
 
-void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnValue0Enabled, RefPtrWillBeRawPtr<NodeList>& returnValue0, bool& returnValue1Enabled, RefPtrWillBeRawPtr<Element>& returnValue1)
+void HTMLOptionsCollection::namedGetter(const AtomicString& name, RefPtrWillBeRawPtr<NodeList>& returnValue0, RefPtrWillBeRawPtr<Element>& returnValue1)
 {
     WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
     this->namedItems(name, namedItems);
@@ -132,14 +127,12 @@ void HTMLOptionsCollection::namedGetter(const AtomicString& name, bool& returnVa
         return;
 
     if (namedItems.size() == 1) {
-        returnValue1Enabled = true;
         returnValue1 = namedItems.at(0);
         return;
     }
 
     // FIXME: The spec and Firefox do not return a NodeList. They always return the first matching Element.
-    returnValue0Enabled = true;
-    returnValue0 = NamedNodesCollection::create(namedItems);
+    returnValue0 = StaticElementList::adopt(namedItems);
 }
 
 bool HTMLOptionsCollection::anonymousIndexedSetter(unsigned index, PassRefPtrWillBeRawPtr<HTMLOptionElement> value, ExceptionState& exceptionState)