|
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 "JSHTMLTextAreaElement.h" |
|
23 |
|
24 #include "HTMLFormElement.h" |
|
25 #include "HTMLNames.h" |
|
26 #include "HTMLTextAreaElement.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/JSNumberCell.h> |
|
36 #include <runtime/JSString.h> |
|
37 #include <wtf/GetPtr.h> |
|
38 |
|
39 using namespace JSC; |
|
40 |
|
41 namespace WebCore { |
|
42 |
|
43 ASSERT_CLASS_FITS_IN_CELL(JSHTMLTextAreaElement); |
|
44 |
|
45 /* Hash table */ |
|
46 #if ENABLE(JIT) |
|
47 #define THUNK_GENERATOR(generator) , generator |
|
48 #else |
|
49 #define THUNK_GENERATOR(generator) |
|
50 #endif |
|
51 |
|
52 static const HashTableValue JSHTMLTextAreaElementTableValues[23] = |
|
53 { |
|
54 { "defaultValue", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementDefaultValue), (intptr_t)setJSHTMLTextAreaElementDefaultValue THUNK_GENERATOR(0) }, |
|
55 { "form", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementForm), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
56 { "validity", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementValidity), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
57 { "accessKey", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementAccessKey), (intptr_t)setJSHTMLTextAreaElementAccessKey THUNK_GENERATOR(0) }, |
|
58 { "cols", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementCols), (intptr_t)setJSHTMLTextAreaElementCols THUNK_GENERATOR(0) }, |
|
59 { "disabled", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementDisabled), (intptr_t)setJSHTMLTextAreaElementDisabled THUNK_GENERATOR(0) }, |
|
60 { "autofocus", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementAutofocus), (intptr_t)setJSHTMLTextAreaElementAutofocus THUNK_GENERATOR(0) }, |
|
61 { "maxLength", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementMaxLength), (intptr_t)setJSHTMLTextAreaElementMaxLength THUNK_GENERATOR(0) }, |
|
62 { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementName), (intptr_t)setJSHTMLTextAreaElementName THUNK_GENERATOR(0) }, |
|
63 { "placeholder", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementPlaceholder), (intptr_t)setJSHTMLTextAreaElementPlaceholder THUNK_GENERATOR(0) }, |
|
64 { "readOnly", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementReadOnly), (intptr_t)setJSHTMLTextAreaElementReadOnly THUNK_GENERATOR(0) }, |
|
65 { "required", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementRequired), (intptr_t)setJSHTMLTextAreaElementRequired THUNK_GENERATOR(0) }, |
|
66 { "rows", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementRows), (intptr_t)setJSHTMLTextAreaElementRows THUNK_GENERATOR(0) }, |
|
67 { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementType), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
68 { "value", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementValue), (intptr_t)setJSHTMLTextAreaElementValue THUNK_GENERATOR(0) }, |
|
69 { "textLength", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementTextLength), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
70 { "willValidate", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementWillValidate), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
71 { "validationMessage", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementValidationMessage), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
72 { "selectionStart", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementSelectionStart), (intptr_t)setJSHTMLTextAreaElementSelectionStart THUNK_GENERATOR(0) }, |
|
73 { "selectionEnd", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementSelectionEnd), (intptr_t)setJSHTMLTextAreaElementSelectionEnd THUNK_GENERATOR(0) }, |
|
74 { "labels", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementLabels), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
75 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTextAreaElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
76 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
77 }; |
|
78 |
|
79 #undef THUNK_GENERATOR |
|
80 static JSC_CONST_HASHTABLE HashTable JSHTMLTextAreaElementTable = { 68, 63, JSHTMLTextAreaElementTableValues, 0 }; |
|
81 /* Hash table for constructor */ |
|
82 #if ENABLE(JIT) |
|
83 #define THUNK_GENERATOR(generator) , generator |
|
84 #else |
|
85 #define THUNK_GENERATOR(generator) |
|
86 #endif |
|
87 |
|
88 static const HashTableValue JSHTMLTextAreaElementConstructorTableValues[1] = |
|
89 { |
|
90 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
91 }; |
|
92 |
|
93 #undef THUNK_GENERATOR |
|
94 static JSC_CONST_HASHTABLE HashTable JSHTMLTextAreaElementConstructorTable = { 1, 0, JSHTMLTextAreaElementConstructorTableValues, 0 }; |
|
95 class JSHTMLTextAreaElementConstructor : public DOMConstructorObject { |
|
96 public: |
|
97 JSHTMLTextAreaElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
98 |
|
99 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
100 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
101 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
102 static const JSC::ClassInfo s_info; |
|
103 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
104 { |
|
105 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
106 } |
|
107 protected: |
|
108 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
109 }; |
|
110 |
|
111 const ClassInfo JSHTMLTextAreaElementConstructor::s_info = { "HTMLTextAreaElementConstructor", 0, &JSHTMLTextAreaElementConstructorTable, 0 }; |
|
112 |
|
113 JSHTMLTextAreaElementConstructor::JSHTMLTextAreaElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
114 : DOMConstructorObject(JSHTMLTextAreaElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
115 { |
|
116 putDirect(exec->propertyNames().prototype, JSHTMLTextAreaElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
117 } |
|
118 |
|
119 bool JSHTMLTextAreaElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
120 { |
|
121 return getStaticValueSlot<JSHTMLTextAreaElementConstructor, DOMObject>(exec, &JSHTMLTextAreaElementConstructorTable, this, propertyName, slot); |
|
122 } |
|
123 |
|
124 bool JSHTMLTextAreaElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
125 { |
|
126 return getStaticValueDescriptor<JSHTMLTextAreaElementConstructor, DOMObject>(exec, &JSHTMLTextAreaElementConstructorTable, this, propertyName, descriptor); |
|
127 } |
|
128 |
|
129 /* Hash table for prototype */ |
|
130 #if ENABLE(JIT) |
|
131 #define THUNK_GENERATOR(generator) , generator |
|
132 #else |
|
133 #define THUNK_GENERATOR(generator) |
|
134 #endif |
|
135 |
|
136 static const HashTableValue JSHTMLTextAreaElementPrototypeTableValues[5] = |
|
137 { |
|
138 { "select", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTextAreaElementPrototypeFunctionSelect), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
139 { "checkValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTextAreaElementPrototypeFunctionCheckValidity), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
140 { "setCustomValidity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTextAreaElementPrototypeFunctionSetCustomValidity), (intptr_t)1 THUNK_GENERATOR(0) }, |
|
141 { "setSelectionRange", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLTextAreaElementPrototypeFunctionSetSelectionRange), (intptr_t)2 THUNK_GENERATOR(0) }, |
|
142 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
143 }; |
|
144 |
|
145 #undef THUNK_GENERATOR |
|
146 static JSC_CONST_HASHTABLE HashTable JSHTMLTextAreaElementPrototypeTable = { 9, 7, JSHTMLTextAreaElementPrototypeTableValues, 0 }; |
|
147 const ClassInfo JSHTMLTextAreaElementPrototype::s_info = { "HTMLTextAreaElementPrototype", 0, &JSHTMLTextAreaElementPrototypeTable, 0 }; |
|
148 |
|
149 JSObject* JSHTMLTextAreaElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
150 { |
|
151 return getDOMPrototype<JSHTMLTextAreaElement>(exec, globalObject); |
|
152 } |
|
153 |
|
154 bool JSHTMLTextAreaElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
155 { |
|
156 return getStaticFunctionSlot<JSObject>(exec, &JSHTMLTextAreaElementPrototypeTable, this, propertyName, slot); |
|
157 } |
|
158 |
|
159 bool JSHTMLTextAreaElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
160 { |
|
161 return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLTextAreaElementPrototypeTable, this, propertyName, descriptor); |
|
162 } |
|
163 |
|
164 const ClassInfo JSHTMLTextAreaElement::s_info = { "HTMLTextAreaElement", &JSHTMLElement::s_info, &JSHTMLTextAreaElementTable, 0 }; |
|
165 |
|
166 JSHTMLTextAreaElement::JSHTMLTextAreaElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLTextAreaElement> impl) |
|
167 : JSHTMLElement(structure, globalObject, impl) |
|
168 { |
|
169 } |
|
170 |
|
171 JSObject* JSHTMLTextAreaElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
172 { |
|
173 return new (exec) JSHTMLTextAreaElementPrototype(globalObject, JSHTMLTextAreaElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); |
|
174 } |
|
175 |
|
176 bool JSHTMLTextAreaElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
177 { |
|
178 return getStaticValueSlot<JSHTMLTextAreaElement, Base>(exec, &JSHTMLTextAreaElementTable, this, propertyName, slot); |
|
179 } |
|
180 |
|
181 bool JSHTMLTextAreaElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
182 { |
|
183 return getStaticValueDescriptor<JSHTMLTextAreaElement, Base>(exec, &JSHTMLTextAreaElementTable, this, propertyName, descriptor); |
|
184 } |
|
185 |
|
186 JSValue jsHTMLTextAreaElementDefaultValue(ExecState* exec, JSValue slotBase, const Identifier&) |
|
187 { |
|
188 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
189 UNUSED_PARAM(exec); |
|
190 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
191 JSValue result = jsString(exec, imp->defaultValue()); |
|
192 return result; |
|
193 } |
|
194 |
|
195 JSValue jsHTMLTextAreaElementForm(ExecState* exec, JSValue slotBase, const Identifier&) |
|
196 { |
|
197 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
198 UNUSED_PARAM(exec); |
|
199 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
200 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->form())); |
|
201 return result; |
|
202 } |
|
203 |
|
204 JSValue jsHTMLTextAreaElementValidity(ExecState* exec, JSValue slotBase, const Identifier&) |
|
205 { |
|
206 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
207 UNUSED_PARAM(exec); |
|
208 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
209 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->validity())); |
|
210 return result; |
|
211 } |
|
212 |
|
213 JSValue jsHTMLTextAreaElementAccessKey(ExecState* exec, JSValue slotBase, const Identifier&) |
|
214 { |
|
215 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
216 UNUSED_PARAM(exec); |
|
217 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
218 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::accesskeyAttr)); |
|
219 return result; |
|
220 } |
|
221 |
|
222 JSValue jsHTMLTextAreaElementCols(ExecState* exec, JSValue slotBase, const Identifier&) |
|
223 { |
|
224 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
225 UNUSED_PARAM(exec); |
|
226 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
227 JSValue result = jsNumber(exec, imp->cols()); |
|
228 return result; |
|
229 } |
|
230 |
|
231 JSValue jsHTMLTextAreaElementDisabled(ExecState* exec, JSValue slotBase, const Identifier&) |
|
232 { |
|
233 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
234 UNUSED_PARAM(exec); |
|
235 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
236 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::disabledAttr)); |
|
237 return result; |
|
238 } |
|
239 |
|
240 JSValue jsHTMLTextAreaElementAutofocus(ExecState* exec, JSValue slotBase, const Identifier&) |
|
241 { |
|
242 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
243 UNUSED_PARAM(exec); |
|
244 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
245 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::autofocusAttr)); |
|
246 return result; |
|
247 } |
|
248 |
|
249 JSValue jsHTMLTextAreaElementMaxLength(ExecState* exec, JSValue slotBase, const Identifier&) |
|
250 { |
|
251 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
252 UNUSED_PARAM(exec); |
|
253 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
254 JSValue result = jsNumber(exec, imp->maxLength()); |
|
255 return result; |
|
256 } |
|
257 |
|
258 JSValue jsHTMLTextAreaElementName(ExecState* exec, JSValue slotBase, const Identifier&) |
|
259 { |
|
260 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
261 UNUSED_PARAM(exec); |
|
262 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
263 JSValue result = jsString(exec, imp->name()); |
|
264 return result; |
|
265 } |
|
266 |
|
267 JSValue jsHTMLTextAreaElementPlaceholder(ExecState* exec, JSValue slotBase, const Identifier&) |
|
268 { |
|
269 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
270 UNUSED_PARAM(exec); |
|
271 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
272 JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::placeholderAttr)); |
|
273 return result; |
|
274 } |
|
275 |
|
276 JSValue jsHTMLTextAreaElementReadOnly(ExecState* exec, JSValue slotBase, const Identifier&) |
|
277 { |
|
278 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
279 UNUSED_PARAM(exec); |
|
280 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
281 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::readonlyAttr)); |
|
282 return result; |
|
283 } |
|
284 |
|
285 JSValue jsHTMLTextAreaElementRequired(ExecState* exec, JSValue slotBase, const Identifier&) |
|
286 { |
|
287 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
288 UNUSED_PARAM(exec); |
|
289 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
290 JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::requiredAttr)); |
|
291 return result; |
|
292 } |
|
293 |
|
294 JSValue jsHTMLTextAreaElementRows(ExecState* exec, JSValue slotBase, const Identifier&) |
|
295 { |
|
296 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
297 UNUSED_PARAM(exec); |
|
298 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
299 JSValue result = jsNumber(exec, imp->rows()); |
|
300 return result; |
|
301 } |
|
302 |
|
303 JSValue jsHTMLTextAreaElementType(ExecState* exec, JSValue slotBase, const Identifier&) |
|
304 { |
|
305 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
306 UNUSED_PARAM(exec); |
|
307 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
308 JSValue result = jsString(exec, imp->type()); |
|
309 return result; |
|
310 } |
|
311 |
|
312 JSValue jsHTMLTextAreaElementValue(ExecState* exec, JSValue slotBase, const Identifier&) |
|
313 { |
|
314 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
315 UNUSED_PARAM(exec); |
|
316 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
317 JSValue result = jsString(exec, imp->value()); |
|
318 return result; |
|
319 } |
|
320 |
|
321 JSValue jsHTMLTextAreaElementTextLength(ExecState* exec, JSValue slotBase, const Identifier&) |
|
322 { |
|
323 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
324 UNUSED_PARAM(exec); |
|
325 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
326 JSValue result = jsNumber(exec, imp->textLength()); |
|
327 return result; |
|
328 } |
|
329 |
|
330 JSValue jsHTMLTextAreaElementWillValidate(ExecState* exec, JSValue slotBase, const Identifier&) |
|
331 { |
|
332 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
333 UNUSED_PARAM(exec); |
|
334 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
335 JSValue result = jsBoolean(imp->willValidate()); |
|
336 return result; |
|
337 } |
|
338 |
|
339 JSValue jsHTMLTextAreaElementValidationMessage(ExecState* exec, JSValue slotBase, const Identifier&) |
|
340 { |
|
341 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
342 UNUSED_PARAM(exec); |
|
343 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
344 JSValue result = jsString(exec, imp->validationMessage()); |
|
345 return result; |
|
346 } |
|
347 |
|
348 JSValue jsHTMLTextAreaElementSelectionStart(ExecState* exec, JSValue slotBase, const Identifier&) |
|
349 { |
|
350 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
351 UNUSED_PARAM(exec); |
|
352 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
353 JSValue result = jsNumber(exec, imp->selectionStart()); |
|
354 return result; |
|
355 } |
|
356 |
|
357 JSValue jsHTMLTextAreaElementSelectionEnd(ExecState* exec, JSValue slotBase, const Identifier&) |
|
358 { |
|
359 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
360 UNUSED_PARAM(exec); |
|
361 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
362 JSValue result = jsNumber(exec, imp->selectionEnd()); |
|
363 return result; |
|
364 } |
|
365 |
|
366 JSValue jsHTMLTextAreaElementLabels(ExecState* exec, JSValue slotBase, const Identifier&) |
|
367 { |
|
368 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
369 UNUSED_PARAM(exec); |
|
370 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
371 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->labels())); |
|
372 return result; |
|
373 } |
|
374 |
|
375 JSValue jsHTMLTextAreaElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
376 { |
|
377 JSHTMLTextAreaElement* domObject = static_cast<JSHTMLTextAreaElement*>(asObject(slotBase)); |
|
378 return JSHTMLTextAreaElement::getConstructor(exec, domObject->globalObject()); |
|
379 } |
|
380 void JSHTMLTextAreaElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
381 { |
|
382 lookupPut<JSHTMLTextAreaElement, Base>(exec, propertyName, value, &JSHTMLTextAreaElementTable, this, slot); |
|
383 } |
|
384 |
|
385 void setJSHTMLTextAreaElementDefaultValue(ExecState* exec, JSObject* thisObject, JSValue value) |
|
386 { |
|
387 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
388 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
389 imp->setDefaultValue(valueToStringWithNullCheck(exec, value)); |
|
390 } |
|
391 |
|
392 void setJSHTMLTextAreaElementAccessKey(ExecState* exec, JSObject* thisObject, JSValue value) |
|
393 { |
|
394 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
395 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
396 imp->setAttribute(WebCore::HTMLNames::accesskeyAttr, valueToStringWithNullCheck(exec, value)); |
|
397 } |
|
398 |
|
399 void setJSHTMLTextAreaElementCols(ExecState* exec, JSObject* thisObject, JSValue value) |
|
400 { |
|
401 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
402 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
403 imp->setCols(value.toInt32(exec)); |
|
404 } |
|
405 |
|
406 void setJSHTMLTextAreaElementDisabled(ExecState* exec, JSObject* thisObject, JSValue value) |
|
407 { |
|
408 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
409 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
410 imp->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, value.toBoolean(exec)); |
|
411 } |
|
412 |
|
413 void setJSHTMLTextAreaElementAutofocus(ExecState* exec, JSObject* thisObject, JSValue value) |
|
414 { |
|
415 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
416 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
417 imp->setBooleanAttribute(WebCore::HTMLNames::autofocusAttr, value.toBoolean(exec)); |
|
418 } |
|
419 |
|
420 void setJSHTMLTextAreaElementMaxLength(ExecState* exec, JSObject* thisObject, JSValue value) |
|
421 { |
|
422 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
423 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
424 ExceptionCode ec = 0; |
|
425 imp->setMaxLength(value.toInt32(exec), ec); |
|
426 setDOMException(exec, ec); |
|
427 } |
|
428 |
|
429 void setJSHTMLTextAreaElementName(ExecState* exec, JSObject* thisObject, JSValue value) |
|
430 { |
|
431 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
432 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
433 imp->setName(valueToStringWithNullCheck(exec, value)); |
|
434 } |
|
435 |
|
436 void setJSHTMLTextAreaElementPlaceholder(ExecState* exec, JSObject* thisObject, JSValue value) |
|
437 { |
|
438 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
439 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
440 imp->setAttribute(WebCore::HTMLNames::placeholderAttr, valueToStringWithNullCheck(exec, value)); |
|
441 } |
|
442 |
|
443 void setJSHTMLTextAreaElementReadOnly(ExecState* exec, JSObject* thisObject, JSValue value) |
|
444 { |
|
445 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
446 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
447 imp->setBooleanAttribute(WebCore::HTMLNames::readonlyAttr, value.toBoolean(exec)); |
|
448 } |
|
449 |
|
450 void setJSHTMLTextAreaElementRequired(ExecState* exec, JSObject* thisObject, JSValue value) |
|
451 { |
|
452 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
453 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
454 imp->setBooleanAttribute(WebCore::HTMLNames::requiredAttr, value.toBoolean(exec)); |
|
455 } |
|
456 |
|
457 void setJSHTMLTextAreaElementRows(ExecState* exec, JSObject* thisObject, JSValue value) |
|
458 { |
|
459 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
460 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
461 imp->setRows(value.toInt32(exec)); |
|
462 } |
|
463 |
|
464 void setJSHTMLTextAreaElementValue(ExecState* exec, JSObject* thisObject, JSValue value) |
|
465 { |
|
466 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
467 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
468 imp->setValue(valueToStringWithNullCheck(exec, value)); |
|
469 } |
|
470 |
|
471 void setJSHTMLTextAreaElementSelectionStart(ExecState* exec, JSObject* thisObject, JSValue value) |
|
472 { |
|
473 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
474 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
475 imp->setSelectionStart(value.toInt32(exec)); |
|
476 } |
|
477 |
|
478 void setJSHTMLTextAreaElementSelectionEnd(ExecState* exec, JSObject* thisObject, JSValue value) |
|
479 { |
|
480 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(thisObject); |
|
481 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
482 imp->setSelectionEnd(value.toInt32(exec)); |
|
483 } |
|
484 |
|
485 JSValue JSHTMLTextAreaElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
486 { |
|
487 return getDOMConstructor<JSHTMLTextAreaElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
488 } |
|
489 |
|
490 EncodedJSValue JSC_HOST_CALL jsHTMLTextAreaElementPrototypeFunctionSelect(ExecState* exec) |
|
491 { |
|
492 JSValue thisValue = exec->hostThisValue(); |
|
493 if (!thisValue.inherits(&JSHTMLTextAreaElement::s_info)) |
|
494 return throwVMTypeError(exec); |
|
495 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(thisValue)); |
|
496 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
497 |
|
498 imp->select(); |
|
499 return JSValue::encode(jsUndefined()); |
|
500 } |
|
501 |
|
502 EncodedJSValue JSC_HOST_CALL jsHTMLTextAreaElementPrototypeFunctionCheckValidity(ExecState* exec) |
|
503 { |
|
504 JSValue thisValue = exec->hostThisValue(); |
|
505 if (!thisValue.inherits(&JSHTMLTextAreaElement::s_info)) |
|
506 return throwVMTypeError(exec); |
|
507 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(thisValue)); |
|
508 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
509 |
|
510 |
|
511 JSC::JSValue result = jsBoolean(imp->checkValidity()); |
|
512 return JSValue::encode(result); |
|
513 } |
|
514 |
|
515 EncodedJSValue JSC_HOST_CALL jsHTMLTextAreaElementPrototypeFunctionSetCustomValidity(ExecState* exec) |
|
516 { |
|
517 JSValue thisValue = exec->hostThisValue(); |
|
518 if (!thisValue.inherits(&JSHTMLTextAreaElement::s_info)) |
|
519 return throwVMTypeError(exec); |
|
520 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(thisValue)); |
|
521 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
522 const String& error = valueToStringWithUndefinedOrNullCheck(exec, exec->argument(0)); |
|
523 |
|
524 imp->setCustomValidity(error); |
|
525 return JSValue::encode(jsUndefined()); |
|
526 } |
|
527 |
|
528 EncodedJSValue JSC_HOST_CALL jsHTMLTextAreaElementPrototypeFunctionSetSelectionRange(ExecState* exec) |
|
529 { |
|
530 JSValue thisValue = exec->hostThisValue(); |
|
531 if (!thisValue.inherits(&JSHTMLTextAreaElement::s_info)) |
|
532 return throwVMTypeError(exec); |
|
533 JSHTMLTextAreaElement* castedThis = static_cast<JSHTMLTextAreaElement*>(asObject(thisValue)); |
|
534 HTMLTextAreaElement* imp = static_cast<HTMLTextAreaElement*>(castedThis->impl()); |
|
535 int start = exec->argument(0).toInt32(exec); |
|
536 int end = exec->argument(1).toInt32(exec); |
|
537 |
|
538 imp->setSelectionRange(start, end); |
|
539 return JSValue::encode(jsUndefined()); |
|
540 } |
|
541 |
|
542 |
|
543 } |