Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLFormControlsCollection.cpp
index a7c4a9f..c386d4a 100644 (file)
@@ -31,7 +31,7 @@
 #include "core/html/HTMLImageElement.h"
 #include "wtf/HashSet.h"
 
-namespace WebCore {
+namespace blink {
 
 using namespace HTMLNames;
 
@@ -44,7 +44,6 @@ HTMLFormControlsCollection::HTMLFormControlsCollection(ContainerNode& ownerNode)
     , m_cachedElementOffsetInArray(0)
 {
     ASSERT(isHTMLFormElement(ownerNode) || isHTMLFieldSetElement(ownerNode));
-    ScriptWrappable::init(this);
 }
 
 PassRefPtrWillBeRawPtr<HTMLFormControlsCollection> HTMLFormControlsCollection::create(ContainerNode& ownerNode, CollectionType type)
@@ -81,7 +80,7 @@ static unsigned findFormAssociatedElement(const FormAssociatedElement::List& ass
     return i;
 }
 
-Element* HTMLFormControlsCollection::virtualItemAfter(Element* previous) const
+HTMLElement* HTMLFormControlsCollection::virtualItemAfter(Element* previous) const
 {
     const FormAssociatedElement::List& associatedElements = formControlElements();
     unsigned offset;
@@ -135,7 +134,7 @@ static HTMLElement* firstNamedItem(const FormAssociatedElement::List& elementsAr
     return 0;
 }
 
-Element* HTMLFormControlsCollection::namedItem(const AtomicString& name) const
+HTMLElement* HTMLFormControlsCollection::namedItem(const AtomicString& name) const
 {
     // http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/nameditem.asp
     // This method first searches for an object with a matching id
@@ -193,7 +192,7 @@ void HTMLFormControlsCollection::updateIdNameCache() const
     setNamedItemCache(cache.release());
 }
 
-void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& radioNodeListEnabled, RefPtrWillBeRawPtr<RadioNodeList>& radioNodeList, bool& elementEnabled, RefPtrWillBeRawPtr<Element>& element)
+void HTMLFormControlsCollection::namedGetter(const AtomicString& name, RefPtrWillBeRawPtr<RadioNodeList>& radioNodeList, RefPtrWillBeRawPtr<Element>& element)
 {
     WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
     this->namedItems(name, namedItems);
@@ -202,12 +201,10 @@ void HTMLFormControlsCollection::namedGetter(const AtomicString& name, bool& rad
         return;
 
     if (namedItems.size() == 1) {
-        elementEnabled = true;
         element = namedItems.at(0);
         return;
     }
 
-    radioNodeListEnabled = true;
     radioNodeList = ownerNode().radioNodeList(name);
 }
 
@@ -221,7 +218,7 @@ void HTMLFormControlsCollection::supportedPropertyNames(Vector<String>& names)
     HashSet<AtomicString> existingNames;
     unsigned length = this->length();
     for (unsigned i = 0; i < length; ++i) {
-        Element* element = item(i);
+        HTMLElement* element = item(i);
         ASSERT(element);
         const AtomicString& idAttribute = element->getIdAttribute();
         if (!idAttribute.isEmpty()) {