Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / html / HTMLAllCollection.cpp
index aacbe26..9b7c0e2 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "core/html/HTMLAllCollection.h"
 
+#include "bindings/core/v8/UnionTypesCore.h"
 #include "core/dom/Element.h"
 #include "core/dom/StaticNodeList.h"
 
@@ -51,13 +52,13 @@ Element* HTMLAllCollection::namedItemWithIndex(const AtomicString& name, unsigne
     updateIdNameCache();
 
     const NamedItemCache& cache = namedItemCache();
-    if (WillBeHeapVector<RawPtrWillBeMember<Element> >* elements = cache.getElementsById(name)) {
+    if (WillBeHeapVector<RawPtrWillBeMember<Element>>* elements = cache.getElementsById(name)) {
         if (index < elements->size())
             return elements->at(index);
         index -= elements->size();
     }
 
-    if (WillBeHeapVector<RawPtrWillBeMember<Element> >* elements = cache.getElementsByName(name)) {
+    if (WillBeHeapVector<RawPtrWillBeMember<Element>>* elements = cache.getElementsByName(name)) {
         if (index < elements->size())
             return elements->at(index);
     }
@@ -65,22 +66,22 @@ Element* HTMLAllCollection::namedItemWithIndex(const AtomicString& name, unsigne
     return 0;
 }
 
-void HTMLAllCollection::namedGetter(const AtomicString& name, RefPtrWillBeRawPtr<NodeList>& returnValue0, RefPtrWillBeRawPtr<Element>& returnValue1)
+void HTMLAllCollection::namedGetter(const AtomicString& name, NodeListOrElement& returnValue)
 {
-    WillBeHeapVector<RefPtrWillBeMember<Element> > namedItems;
+    WillBeHeapVector<RefPtrWillBeMember<Element>> namedItems;
     this->namedItems(name, namedItems);
 
     if (!namedItems.size())
         return;
 
     if (namedItems.size() == 1) {
-        returnValue1 = namedItems.at(0);
+        returnValue.setElement(namedItems.at(0));
         return;
     }
 
     // FIXME: HTML5 specification says this should be a HTMLCollection.
     // http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
-    returnValue0 = StaticElementList::adopt(namedItems);
+    returnValue.setNodeList(StaticElementList::adopt(namedItems));
 }
 
 } // namespace blink