|
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 "JSHTMLButtonElement.h" |
|
23 |
|
24 #include "HTMLButtonElement.h" |
|
25 #include "HTMLFormElement.h" |
|
26 #include "HTMLNames.h" |
|
27 #include "JSHTMLFormElement.h" |
|
28 #include "JSNodeList.h" |
|
29 #include "JSValidityState.h" |
|
30 #include "KURL.h" |
|
31 #include "NameNodeList.h" |
|
32 #include "NodeList.h" |
|
33 #include "ValidityState.h" |
|
34 #include <runtime/Error.h> |
|
35 #include <runtime/JSString.h> |
|
36 #include <wtf/GetPtr.h> |
|
37 |
|
38 using namespace JSC; |
|
39 |
|
40 namespace WebCore { |
|
41 |
|
42 ASSERT_CLASS_FITS_IN_CELL(JSHTMLButtonElement); |
|
43 |
|
44 /* Hash table */ |
|
45 #if ENABLE(JIT) |
|
46 #define THUNK_GENERATOR(generator) , generator |
|
47 #else |
|
48 #define THUNK_GENERATOR(generator) |
|
49 #endif |
|
50 |
|
51 static const HashTableValue JSHTMLButtonElementTableValues[14] = |
|
52 { |
|
53 { "form", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementForm), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
54 { "formNoValidate", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementFormNoValidate), (intptr_t)setJSHTMLButtonElementFormNoValidate THUNK_GENERATOR(0) }, |
|
55 { "validity", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementValidity), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "accessKey", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementAccessKey), (intptr_t)setJSHTMLButtonElementAccessKey THUNK_GENERATOR(0) }, |
|
57 { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementDisabled), (intptr_t)setJSHTMLButtonElementDisabled THUNK_GENERATOR(0) }, |
|
58 { "autofocus", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementAutofocus), (intptr_t)setJSHTMLButtonElementAutofocus THUNK_GENERATOR(0) }, |
|
59 { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementName), (intptr_t)setJSHTMLButtonElementName THUNK_GENERATOR(0) }, |
|
60 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementType), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
61 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementValue), (intptr_t)setJSHTMLButtonElementValue THUNK_GENERATOR(0) }, |
|
62 { "willValidate", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementWillValidate), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
63 { "validationMessage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementValidationMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
64 { "labels", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementLabels), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
65 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLButtonElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
66 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
67 }; |
|
68 |
|
69 #undef THUNK_GENERATOR |
|
70 static JSC_CONST_HASHTABLE HashTable JSHTMLButtonElementTable = { 34, 31, JSHTMLButtonElementTableValues, 0 }; |
|
71 /* Hash table for constructor */ |
|
72 #if ENABLE(JIT) |
|
73 #define THUNK_GENERATOR(generator) , generator |
|
74 #else |
|
75 #define THUNK_GENERATOR(generator) |
|
76 #endif |
|
77 |
|
78 static const HashTableValue JSHTMLButtonElementConstructorTableValues[1] = |
|
79 { |
|
80 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
81 }; |
|
82 |
|
83 #undef THUNK_GENERATOR |
|
84 static JSC_CONST_HASHTABLE HashTable JSHTMLButtonElementConstructorTable = { 1, 0, JSHTMLButtonElementConstructorTableValues, 0 }; |
|
85 class JSHTMLButtonElementConstructor : public DOMConstructorObject { |
|
86 public: |
|
87 JSHTMLButtonElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
88 |
|
89 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
90 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
91 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
92 static const JSC::ClassInfo s_info; |
|
93 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
94 { |
|
95 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
96 } |
|
97 protected: |
|
98 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
99 }; |
|
100 |
|
101 const ClassInfo JSHTMLButtonElementConstructor::s_info = { "HTMLButtonElementConstructor", 0, &JSHTMLButtonElementConstructorTable, 0 }; |
|
102 |
|
103 JSHTMLButtonElementConstructor::JSHTMLButtonElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
104 : DOMConstructorObject(JSHTMLButtonElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
105 { |
|
106 putDirect(exec->propertyNames().prototype, JSHTMLButtonElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
107 } |
|
108 |
|
109 bool JSHTMLButtonElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
110 { |
|
111 return getStaticValueSlot<JSHTMLButtonElementConstructor, DOMObject>(exec, &JSHTMLButtonElementConstructorTable, this, propertyName, slot); |
|
112 } |
|
113 |
|
114 bool JSHTMLButtonElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
115 { |
|
116 return getStaticValueDescriptor<JSHTMLButtonElementConstructor, DOMObject>(exec, &JSHTMLButtonElementConstructorTable, this, propertyName, descriptor); |
|
117 } |
|
118 |
|
119 /* Hash table for prototype */ |
|
120 #if ENABLE(JIT) |
|
121 #define THUNK_GENERATOR(generator) , generator |
|
122 #else |
|
123 #define THUNK_GENERATOR(generator) |
|
124 #endif |
|
125 |
|
126 static const HashTableValue JSHTMLButtonElementPrototypeTableValues[4] = |
|
127 { |
|
128 { "checkValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLButtonElementPrototypeFunctionCheckValidity), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
129 { "setCustomValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLButtonElementPrototypeFunctionSetCustomValidity), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
130 { "click", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLButtonElementPrototypeFunctionClick), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
131 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
132 }; |
|
133 |
|
134 #undef THUNK_GENERATOR |
|
135 static JSC_CONST_HASHTABLE HashTable JSHTMLButtonElementPrototypeTable = { 8, 7, JSHTMLButtonElementPrototypeTableValues, 0 }; |
|
136 const ClassInfo JSHTMLButtonElementPrototype::s_info = { "HTMLButtonElementPrototype", 0, &JSHTMLButtonElementPrototypeTable, 0 }; |
|
137 |
|
138 JSObject* JSHTMLButtonElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
139 { |
|
140 return getDOMPrototype<JSHTMLButtonElement>(exec, globalObject); |
|
141 } |
|
142 |
|
143 bool JSHTMLButtonElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
144 { |
|
145 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLButtonElementPrototypeTable, this, propertyName, slot); |
|
146 } |
|
147 |
|
148 bool JSHTMLButtonElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
149 { |
|
150 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLButtonElementPrototypeTable, this, propertyName, descriptor); |
|
151 } |
|
152 |
|
153 const ClassInfo JSHTMLButtonElement::s_info = { "HTMLButtonElement", &JSHTMLElement::s_info, &JSHTMLButtonElementTable, 0 }; |
|
154 |
|
155 JSHTMLButtonElement::JSHTMLButtonElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLButtonElement> impl) |
|
156 : JSHTMLElement(structure, globalObject, impl) |
|
157 { |
|
158 } |
|
159 |
|
160 JSObject* JSHTMLButtonElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
161 { |
|
162 return new (exec) JSHTMLButtonElementPrototype(globalObject, JSHTMLButtonElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
163 } |
|
164 |
|
165 bool JSHTMLButtonElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
166 { |
|
167 return getStaticValueSlot<JSHTMLButtonElement, Base>(exec, &JSHTMLButtonElementTable, this, propertyName, slot); |
|
168 } |
|
169 |
|
170 bool JSHTMLButtonElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
171 { |
|
172 return getStaticValueDescriptor<JSHTMLButtonElement, Base>(exec, &JSHTMLButtonElementTable, this, propertyName, descriptor); |
|
173 } |
|
174 |
|
175 JSValue jsHTMLButtonElementForm(ExecState* exec, JSValue slotBase, const Identifier&) |
|
176 { |
|
177 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
178 UNUSED_PARAM(exec); |
|
179 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
180 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form())); |
|
181 return result; |
|
182 } |
|
183 |
|
184 JSValue jsHTMLButtonElementFormNoValidate(ExecState* exec, JSValue slotBase, const Identifier&) |
|
185 { |
|
186 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
187 UNUSED_PARAM(exec); |
|
188 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
189 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::formnovalidateAttr)); |
|
190 return result; |
|
191 } |
|
192 |
|
193 JSValue jsHTMLButtonElementValidity(ExecState* exec, JSValue slotBase, const Identifier&) |
|
194 { |
|
195 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
196 UNUSED_PARAM(exec); |
|
197 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
198 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->validity())); |
|
199 return result; |
|
200 } |
|
201 |
|
202 JSValue jsHTMLButtonElementAccessKey(ExecState* exec, JSValue slotBase, const Identifier&) |
|
203 { |
|
204 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
205 UNUSED_PARAM(exec); |
|
206 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
207 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::accesskeyAttr)); |
|
208 return result; |
|
209 } |
|
210 |
|
211 JSValue jsHTMLButtonElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&) |
|
212 { |
|
213 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
214 UNUSED_PARAM(exec); |
|
215 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
216 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::disabledAttr)); |
|
217 return result; |
|
218 } |
|
219 |
|
220 JSValue jsHTMLButtonElementAutofocus(ExecState* exec, JSValue slotBase, const Identifier&) |
|
221 { |
|
222 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
223 UNUSED_PARAM(exec); |
|
224 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
225 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::autofocusAttr)); |
|
226 return result; |
|
227 } |
|
228 |
|
229 JSValue jsHTMLButtonElementName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
230 { |
|
231 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
232 UNUSED_PARAM(exec); |
|
233 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
234 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr)); |
|
235 return result; |
|
236 } |
|
237 |
|
238 JSValue jsHTMLButtonElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
239 { |
|
240 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
241 UNUSED_PARAM(exec); |
|
242 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
243 JSValue result = jsString(exec, imp->type()); |
|
244 return result; |
|
245 } |
|
246 |
|
247 JSValue jsHTMLButtonElementValue(ExecState* exec, JSValue slotBase, const Identifier&) |
|
248 { |
|
249 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
250 UNUSED_PARAM(exec); |
|
251 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
252 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::valueAttr)); |
|
253 return result; |
|
254 } |
|
255 |
|
256 JSValue jsHTMLButtonElementWillValidate(ExecState* exec, JSValue slotBase, const Identifier&) |
|
257 { |
|
258 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
259 UNUSED_PARAM(exec); |
|
260 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
261 JSValue result = jsBoolean(imp->willValidate()); |
|
262 return result; |
|
263 } |
|
264 |
|
265 JSValue jsHTMLButtonElementValidationMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
266 { |
|
267 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
268 UNUSED_PARAM(exec); |
|
269 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
270 JSValue result = jsString(exec, imp->validationMessage()); |
|
271 return result; |
|
272 } |
|
273 |
|
274 JSValue jsHTMLButtonElementLabels(ExecState* exec, JSValue slotBase, const Identifier&) |
|
275 { |
|
276 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
277 UNUSED_PARAM(exec); |
|
278 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
279 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->labels())); |
|
280 return result; |
|
281 } |
|
282 |
|
283 JSValue jsHTMLButtonElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
284 { |
|
285 JSHTMLButtonElement* domObject = static_cast<JSHTMLButtonElement*>(asObject(slotBase)); |
|
286 return JSHTMLButtonElement::getConstructor(exec, domObject->globalObject()); |
|
287 } |
|
288 void JSHTMLButtonElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
289 { |
|
290 lookupPut<JSHTMLButtonElement, Base>(exec, propertyName, value, &JSHTMLButtonElementTable, this, slot); |
|
291 } |
|
292 |
|
293 void setJSHTMLButtonElementFormNoValidate(ExecState* exec, JSObject* thisObject, JSValue value) |
|
294 { |
|
295 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(thisObject); |
|
296 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
297 imp->setBooleanAttribute(WebCore::HTMLNames::formnovalidateAttr, value.toBoolean(exec)); |
|
298 } |
|
299 |
|
300 void setJSHTMLButtonElementAccessKey(ExecState* exec, JSObject* thisObject, JSValue value) |
|
301 { |
|
302 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(thisObject); |
|
303 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
304 imp->setAttribute(WebCore::HTMLNames::accesskeyAttr, valueToStringWithNullCheck(exec, value)); |
|
305 } |
|
306 |
|
307 void setJSHTMLButtonElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value) |
|
308 { |
|
309 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(thisObject); |
|
310 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
311 imp->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, value.toBoolean(exec)); |
|
312 } |
|
313 |
|
314 void setJSHTMLButtonElementAutofocus(ExecState* exec, JSObject* thisObject, JSValue value) |
|
315 { |
|
316 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(thisObject); |
|
317 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
318 imp->setBooleanAttribute(WebCore::HTMLNames::autofocusAttr, value.toBoolean(exec)); |
|
319 } |
|
320 |
|
321 void setJSHTMLButtonElementName(ExecState* exec, JSObject* thisObject, JSValue value) |
|
322 { |
|
323 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(thisObject); |
|
324 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
325 imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); |
|
326 } |
|
327 |
|
328 void setJSHTMLButtonElementValue(ExecState* exec, JSObject* thisObject, JSValue value) |
|
329 { |
|
330 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(thisObject); |
|
331 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
332 imp->setAttribute(WebCore::HTMLNames::valueAttr, valueToStringWithNullCheck(exec, value)); |
|
333 } |
|
334 |
|
335 JSValue JSHTMLButtonElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
336 { |
|
337 return getDOMConstructor<JSHTMLButtonElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
338 } |
|
339 |
|
340 EncodedJSValue JSC_HOST_CALL jsHTMLButtonElementPrototypeFunctionCheckValidity(ExecState* exec) |
|
341 { |
|
342 JSValue thisValue = exec->hostThisValue(); |
|
343 if (!thisValue.inherits(&JSHTMLButtonElement::s_info)) |
|
344 return throwVMTypeError(exec); |
|
345 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(thisValue)); |
|
346 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
347 |
|
348 |
|
349 JSC::JSValue result = jsBoolean(imp->checkValidity()); |
|
350 return JSValue::encode(result); |
|
351 } |
|
352 |
|
353 EncodedJSValue JSC_HOST_CALL jsHTMLButtonElementPrototypeFunctionSetCustomValidity(ExecState* exec) |
|
354 { |
|
355 JSValue thisValue = exec->hostThisValue(); |
|
356 if (!thisValue.inherits(&JSHTMLButtonElement::s_info)) |
|
357 return throwVMTypeError(exec); |
|
358 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(thisValue)); |
|
359 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
360 const String& error = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)); |
|
361 |
|
362 imp->setCustomValidity(error); |
|
363 return JSValue::encode(jsUndefined()); |
|
364 } |
|
365 |
|
366 EncodedJSValue JSC_HOST_CALL jsHTMLButtonElementPrototypeFunctionClick(ExecState* exec) |
|
367 { |
|
368 JSValue thisValue = exec->hostThisValue(); |
|
369 if (!thisValue.inherits(&JSHTMLButtonElement::s_info)) |
|
370 return throwVMTypeError(exec); |
|
371 JSHTMLButtonElement* castedThis = static_cast<JSHTMLButtonElement*>(asObject(thisValue)); |
|
372 HTMLButtonElement* imp = static_cast<HTMLButtonElement*>(castedThis->impl()); |
|
373 |
|
374 imp->click(); |
|
375 return JSValue::encode(jsUndefined()); |
|
376 } |
|
377 |
|
378 |
|
379 } |