|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 #include "JSHTMLFormElement.h" |
|
23 |
|
24 #include "AtomicString.h" |
|
25 #include "HTMLCollection.h" |
|
26 #include "HTMLFormElement.h" |
|
27 #include "HTMLNames.h" |
|
28 #include "JSHTMLCollection.h" |
|
29 #include "KURL.h" |
|
30 #include <runtime/Error.h> |
|
31 #include <runtime/JSNumberCell.h> |
|
32 #include <runtime/JSString.h> |
|
33 #include <runtime/PropertyNameArray.h> |
|
34 #include <wtf/GetPtr.h> |
|
35 |
|
36 using namespace JSC; |
|
37 |
|
38 namespace WebCore { |
|
39 |
|
40 ASSERT_CLASS_FITS_IN_CELL(JSHTMLFormElement); |
|
41 |
|
42 /* Hash table */ |
|
43 #if ENABLE(JIT) |
|
44 #define THUNK_GENERATOR(generator) , generator |
|
45 #else |
|
46 #define THUNK_GENERATOR(generator) |
|
47 #endif |
|
48 |
|
49 static const HashTableValue JSHTMLFormElementTableValues[12] = |
|
50 { |
|
51 { "elements", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementElements), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
52 { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementLength), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
53 { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementName), (intptr_t)setJSHTMLFormElementName THUNK_GENERATOR(0) }, |
|
54 { "noValidate", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementNoValidate), (intptr_t)setJSHTMLFormElementNoValidate THUNK_GENERATOR(0) }, |
|
55 { "acceptCharset", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementAcceptCharset), (intptr_t)setJSHTMLFormElementAcceptCharset THUNK_GENERATOR(0) }, |
|
56 { "action", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementAction), (intptr_t)setJSHTMLFormElementAction THUNK_GENERATOR(0) }, |
|
57 { "encoding", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementEncoding), (intptr_t)setJSHTMLFormElementEncoding THUNK_GENERATOR(0) }, |
|
58 { "enctype", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementEnctype), (intptr_t)setJSHTMLFormElementEnctype THUNK_GENERATOR(0) }, |
|
59 { "method", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementMethod), (intptr_t)setJSHTMLFormElementMethod THUNK_GENERATOR(0) }, |
|
60 { "target", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementTarget), (intptr_t)setJSHTMLFormElementTarget THUNK_GENERATOR(0) }, |
|
61 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFormElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
62 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
63 }; |
|
64 |
|
65 #undef THUNK_GENERATOR |
|
66 static JSC_CONST_HASHTABLE HashTable JSHTMLFormElementTable = { 35, 31, JSHTMLFormElementTableValues, 0 }; |
|
67 /* Hash table for constructor */ |
|
68 #if ENABLE(JIT) |
|
69 #define THUNK_GENERATOR(generator) , generator |
|
70 #else |
|
71 #define THUNK_GENERATOR(generator) |
|
72 #endif |
|
73 |
|
74 static const HashTableValue JSHTMLFormElementConstructorTableValues[1] = |
|
75 { |
|
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
77 }; |
|
78 |
|
79 #undef THUNK_GENERATOR |
|
80 static JSC_CONST_HASHTABLE HashTable JSHTMLFormElementConstructorTable = { 1, 0, JSHTMLFormElementConstructorTableValues, 0 }; |
|
81 class JSHTMLFormElementConstructor : public DOMConstructorObject { |
|
82 public: |
|
83 JSHTMLFormElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
84 |
|
85 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
86 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
87 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
88 static const JSC::ClassInfo s_info; |
|
89 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
90 { |
|
91 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
92 } |
|
93 protected: |
|
94 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
95 }; |
|
96 |
|
97 const ClassInfo JSHTMLFormElementConstructor::s_info = { "HTMLFormElementConstructor", 0, &JSHTMLFormElementConstructorTable, 0 }; |
|
98 |
|
99 JSHTMLFormElementConstructor::JSHTMLFormElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
100 : DOMConstructorObject(JSHTMLFormElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
101 { |
|
102 putDirect(exec->propertyNames().prototype, JSHTMLFormElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
103 } |
|
104 |
|
105 bool JSHTMLFormElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
106 { |
|
107 return getStaticValueSlot<JSHTMLFormElementConstructor, DOMObject>(exec, &JSHTMLFormElementConstructorTable, this, propertyName, slot); |
|
108 } |
|
109 |
|
110 bool JSHTMLFormElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
111 { |
|
112 return getStaticValueDescriptor<JSHTMLFormElementConstructor, DOMObject>(exec, &JSHTMLFormElementConstructorTable, this, propertyName, descriptor); |
|
113 } |
|
114 |
|
115 /* Hash table for prototype */ |
|
116 #if ENABLE(JIT) |
|
117 #define THUNK_GENERATOR(generator) , generator |
|
118 #else |
|
119 #define THUNK_GENERATOR(generator) |
|
120 #endif |
|
121 |
|
122 static const HashTableValue JSHTMLFormElementPrototypeTableValues[4] = |
|
123 { |
|
124 { "submit", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFormElementPrototypeFunctionSubmit), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
125 { "reset", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFormElementPrototypeFunctionReset), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
126 { "checkValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFormElementPrototypeFunctionCheckValidity), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
127 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
128 }; |
|
129 |
|
130 #undef THUNK_GENERATOR |
|
131 static JSC_CONST_HASHTABLE HashTable JSHTMLFormElementPrototypeTable = { 9, 7, JSHTMLFormElementPrototypeTableValues, 0 }; |
|
132 const ClassInfo JSHTMLFormElementPrototype::s_info = { "HTMLFormElementPrototype", 0, &JSHTMLFormElementPrototypeTable, 0 }; |
|
133 |
|
134 JSObject* JSHTMLFormElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
135 { |
|
136 return getDOMPrototype<JSHTMLFormElement>(exec, globalObject); |
|
137 } |
|
138 |
|
139 bool JSHTMLFormElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
140 { |
|
141 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLFormElementPrototypeTable, this, propertyName, slot); |
|
142 } |
|
143 |
|
144 bool JSHTMLFormElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
145 { |
|
146 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLFormElementPrototypeTable, this, propertyName, descriptor); |
|
147 } |
|
148 |
|
149 const ClassInfo JSHTMLFormElement::s_info = { "HTMLFormElement", &JSHTMLElement::s_info, &JSHTMLFormElementTable, 0 }; |
|
150 |
|
151 JSHTMLFormElement::JSHTMLFormElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLFormElement> impl) |
|
152 : JSHTMLElement(structure, globalObject, impl) |
|
153 { |
|
154 } |
|
155 |
|
156 JSObject* JSHTMLFormElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
157 { |
|
158 return new (exec) JSHTMLFormElementPrototype(globalObject, JSHTMLFormElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
159 } |
|
160 |
|
161 bool JSHTMLFormElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
162 { |
|
163 bool ok; |
|
164 unsigned index = propertyName.toUInt32(&ok, false); |
|
165 if (ok && index < static_cast<HTMLFormElement*>(impl())->length()) { |
|
166 slot.setCustomIndex(this, index, indexGetter); |
|
167 return true; |
|
168 } |
|
169 if (canGetItemsForName(exec, static_cast<HTMLFormElement*>(impl()), propertyName)) { |
|
170 slot.setCustom(this, nameGetter); |
|
171 return true; |
|
172 } |
|
173 const HashEntry* entry = JSHTMLFormElementTable.entry(exec, propertyName); |
|
174 if (entry) { |
|
175 slot.setCustom(this, entry->propertyGetter()); |
|
176 return true; |
|
177 } |
|
178 return getStaticValueSlot<JSHTMLFormElement, Base>(exec, &JSHTMLFormElementTable, this, propertyName, slot); |
|
179 } |
|
180 |
|
181 bool JSHTMLFormElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
182 { |
|
183 bool ok; |
|
184 unsigned index = propertyName.toUInt32(&ok, false); |
|
185 if (ok && index < static_cast<HTMLFormElement*>(impl())->length()) { |
|
186 PropertySlot slot; |
|
187 slot.setCustomIndex(this, index, indexGetter); |
|
188 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); |
|
189 return true; |
|
190 } |
|
191 if (canGetItemsForName(exec, static_cast<HTMLFormElement*>(impl()), propertyName)) { |
|
192 PropertySlot slot; |
|
193 slot.setCustom(this, nameGetter); |
|
194 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); |
|
195 return true; |
|
196 } |
|
197 const HashEntry* entry = JSHTMLFormElementTable.entry(exec, propertyName); |
|
198 if (entry) { |
|
199 PropertySlot slot; |
|
200 slot.setCustom(this, entry->propertyGetter()); |
|
201 descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes()); |
|
202 return true; |
|
203 } |
|
204 return getStaticValueDescriptor<JSHTMLFormElement, Base>(exec, &JSHTMLFormElementTable, this, propertyName, descriptor); |
|
205 } |
|
206 |
|
207 JSValue jsHTMLFormElementElements(ExecState* exec, JSValue slotBase, const Identifier&) |
|
208 { |
|
209 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
210 UNUSED_PARAM(exec); |
|
211 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
212 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->elements())); |
|
213 return result; |
|
214 } |
|
215 |
|
216 JSValue jsHTMLFormElementLength(ExecState* exec, JSValue slotBase, const Identifier&) |
|
217 { |
|
218 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
219 UNUSED_PARAM(exec); |
|
220 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
221 JSValue result = jsNumber(exec, imp->length()); |
|
222 return result; |
|
223 } |
|
224 |
|
225 JSValue jsHTMLFormElementName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
226 { |
|
227 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
228 UNUSED_PARAM(exec); |
|
229 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
230 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr)); |
|
231 return result; |
|
232 } |
|
233 |
|
234 JSValue jsHTMLFormElementNoValidate(ExecState* exec, JSValue slotBase, const Identifier&) |
|
235 { |
|
236 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
237 UNUSED_PARAM(exec); |
|
238 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
239 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::novalidateAttr)); |
|
240 return result; |
|
241 } |
|
242 |
|
243 JSValue jsHTMLFormElementAcceptCharset(ExecState* exec, JSValue slotBase, const Identifier&) |
|
244 { |
|
245 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
246 UNUSED_PARAM(exec); |
|
247 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
248 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::accept_charsetAttr)); |
|
249 return result; |
|
250 } |
|
251 |
|
252 JSValue jsHTMLFormElementAction(ExecState* exec, JSValue slotBase, const Identifier&) |
|
253 { |
|
254 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
255 UNUSED_PARAM(exec); |
|
256 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
257 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::actionAttr)); |
|
258 return result; |
|
259 } |
|
260 |
|
261 JSValue jsHTMLFormElementEncoding(ExecState* exec, JSValue slotBase, const Identifier&) |
|
262 { |
|
263 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
264 UNUSED_PARAM(exec); |
|
265 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
266 JSValue result = jsString(exec, imp->encoding()); |
|
267 return result; |
|
268 } |
|
269 |
|
270 JSValue jsHTMLFormElementEnctype(ExecState* exec, JSValue slotBase, const Identifier&) |
|
271 { |
|
272 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
273 UNUSED_PARAM(exec); |
|
274 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
275 JSValue result = jsString(exec, imp->enctype()); |
|
276 return result; |
|
277 } |
|
278 |
|
279 JSValue jsHTMLFormElementMethod(ExecState* exec, JSValue slotBase, const Identifier&) |
|
280 { |
|
281 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
282 UNUSED_PARAM(exec); |
|
283 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
284 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::methodAttr)); |
|
285 return result; |
|
286 } |
|
287 |
|
288 JSValue jsHTMLFormElementTarget(ExecState* exec, JSValue slotBase, const Identifier&) |
|
289 { |
|
290 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
291 UNUSED_PARAM(exec); |
|
292 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
293 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::targetAttr)); |
|
294 return result; |
|
295 } |
|
296 |
|
297 JSValue jsHTMLFormElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
298 { |
|
299 JSHTMLFormElement* domObject = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
300 return JSHTMLFormElement::getConstructor(exec, domObject->globalObject()); |
|
301 } |
|
302 void JSHTMLFormElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
303 { |
|
304 lookupPut<JSHTMLFormElement, Base>(exec, propertyName, value, &JSHTMLFormElementTable, this, slot); |
|
305 } |
|
306 |
|
307 void setJSHTMLFormElementName(ExecState* exec, JSObject* thisObject, JSValue value) |
|
308 { |
|
309 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
310 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
311 imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); |
|
312 } |
|
313 |
|
314 void setJSHTMLFormElementNoValidate(ExecState* exec, JSObject* thisObject, JSValue value) |
|
315 { |
|
316 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
317 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
318 imp->setBooleanAttribute(WebCore::HTMLNames::novalidateAttr, value.toBoolean(exec)); |
|
319 } |
|
320 |
|
321 void setJSHTMLFormElementAcceptCharset(ExecState* exec, JSObject* thisObject, JSValue value) |
|
322 { |
|
323 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
324 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
325 imp->setAttribute(WebCore::HTMLNames::accept_charsetAttr, valueToStringWithNullCheck(exec, value)); |
|
326 } |
|
327 |
|
328 void setJSHTMLFormElementAction(ExecState* exec, JSObject* thisObject, JSValue value) |
|
329 { |
|
330 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
331 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
332 imp->setAttribute(WebCore::HTMLNames::actionAttr, valueToStringWithNullCheck(exec, value)); |
|
333 } |
|
334 |
|
335 void setJSHTMLFormElementEncoding(ExecState* exec, JSObject* thisObject, JSValue value) |
|
336 { |
|
337 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
338 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
339 imp->setEncoding(valueToStringWithNullCheck(exec, value)); |
|
340 } |
|
341 |
|
342 void setJSHTMLFormElementEnctype(ExecState* exec, JSObject* thisObject, JSValue value) |
|
343 { |
|
344 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
345 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
346 imp->setEnctype(valueToStringWithNullCheck(exec, value)); |
|
347 } |
|
348 |
|
349 void setJSHTMLFormElementMethod(ExecState* exec, JSObject* thisObject, JSValue value) |
|
350 { |
|
351 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
352 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
353 imp->setAttribute(WebCore::HTMLNames::methodAttr, valueToStringWithNullCheck(exec, value)); |
|
354 } |
|
355 |
|
356 void setJSHTMLFormElementTarget(ExecState* exec, JSObject* thisObject, JSValue value) |
|
357 { |
|
358 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(thisObject); |
|
359 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
360 imp->setAttribute(WebCore::HTMLNames::targetAttr, valueToStringWithNullCheck(exec, value)); |
|
361 } |
|
362 |
|
363 void JSHTMLFormElement::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) |
|
364 { |
|
365 for (unsigned i = 0; i < static_cast<HTMLFormElement*>(impl())->length(); ++i) |
|
366 propertyNames.add(Identifier::from(exec, i)); |
|
367 Base::getOwnPropertyNames(exec, propertyNames, mode); |
|
368 } |
|
369 |
|
370 JSValue JSHTMLFormElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
371 { |
|
372 return getDOMConstructor<JSHTMLFormElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
373 } |
|
374 |
|
375 EncodedJSValue JSC_HOST_CALL jsHTMLFormElementPrototypeFunctionSubmit(ExecState* exec) |
|
376 { |
|
377 JSValue thisValue = exec->hostThisValue(); |
|
378 if (!thisValue.inherits(&JSHTMLFormElement::s_info)) |
|
379 return throwVMTypeError(exec); |
|
380 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(thisValue)); |
|
381 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
382 Frame* dynamicFrame = toDynamicFrame(exec); |
|
383 if (!dynamicFrame) |
|
384 return JSValue::encode(jsUndefined()); |
|
385 |
|
386 imp->submit(dynamicFrame); |
|
387 return JSValue::encode(jsUndefined()); |
|
388 } |
|
389 |
|
390 EncodedJSValue JSC_HOST_CALL jsHTMLFormElementPrototypeFunctionReset(ExecState* exec) |
|
391 { |
|
392 JSValue thisValue = exec->hostThisValue(); |
|
393 if (!thisValue.inherits(&JSHTMLFormElement::s_info)) |
|
394 return throwVMTypeError(exec); |
|
395 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(thisValue)); |
|
396 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
397 |
|
398 imp->reset(); |
|
399 return JSValue::encode(jsUndefined()); |
|
400 } |
|
401 |
|
402 EncodedJSValue JSC_HOST_CALL jsHTMLFormElementPrototypeFunctionCheckValidity(ExecState* exec) |
|
403 { |
|
404 JSValue thisValue = exec->hostThisValue(); |
|
405 if (!thisValue.inherits(&JSHTMLFormElement::s_info)) |
|
406 return throwVMTypeError(exec); |
|
407 JSHTMLFormElement* castedThis = static_cast<JSHTMLFormElement*>(asObject(thisValue)); |
|
408 HTMLFormElement* imp = static_cast<HTMLFormElement*>(castedThis->impl()); |
|
409 |
|
410 |
|
411 JSC::JSValue result = jsBoolean(imp->checkValidity()); |
|
412 return JSValue::encode(result); |
|
413 } |
|
414 |
|
415 |
|
416 JSValue JSHTMLFormElement::indexGetter(ExecState* exec, JSValue slotBase, unsigned index) |
|
417 { |
|
418 JSHTMLFormElement* thisObj = static_cast<JSHTMLFormElement*>(asObject(slotBase)); |
|
419 return toJS(exec, thisObj->globalObject(), static_cast<HTMLFormElement*>(thisObj->impl())->item(index)); |
|
420 } |
|
421 |
|
422 } |