OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "core/dom/NamedNodesCollection.h" | 40 #include "core/dom/NamedNodesCollection.h" |
41 #include "core/html/HTMLOptionElement.h" | 41 #include "core/html/HTMLOptionElement.h" |
42 #include "core/html/HTMLOptionsCollection.h" | 42 #include "core/html/HTMLOptionsCollection.h" |
43 #include "core/html/HTMLSelectElement.h" | 43 #include "core/html/HTMLSelectElement.h" |
44 | 44 |
45 namespace WebCore { | 45 namespace WebCore { |
46 | 46 |
47 template<typename CallbackInfo> | 47 template<typename CallbackInfo> |
48 static void getNamedItems(HTMLOptionsCollection* collection, const AtomicString&
name, const CallbackInfo& info) | 48 static void getNamedItems(HTMLOptionsCollection* collection, const AtomicString&
name, const CallbackInfo& info) |
49 { | 49 { |
50 Vector<RefPtr<Node> > namedItems; | 50 Vector<RefPtr<Element> > namedItems; |
51 collection->namedItems(name, namedItems); | 51 collection->namedItems(name, namedItems); |
52 | 52 |
53 if (!namedItems.size()) { | 53 if (!namedItems.size()) { |
54 v8SetReturnValueNull(info); | 54 v8SetReturnValueNull(info); |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 if (namedItems.size() == 1) { | 58 if (namedItems.size() == 1) { |
59 v8SetReturnValueFast(info, namedItems.at(0).release(), collection); | 59 v8SetReturnValueFast(info, namedItems.at(0).release(), collection); |
60 return; | 60 return; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 newLength = static_cast<unsigned>(v); | 108 newLength = static_cast<unsigned>(v); |
109 } | 109 } |
110 | 110 |
111 if (exceptionState.throwIfNeeded()) | 111 if (exceptionState.throwIfNeeded()) |
112 return; | 112 return; |
113 | 113 |
114 imp->setLength(newLength, exceptionState); | 114 imp->setLength(newLength, exceptionState); |
115 } | 115 } |
116 | 116 |
117 } // namespace WebCore | 117 } // namespace WebCore |
OLD | NEW |