1 | /* |
2 | * This file is part of the WebKit open source project. |
3 | * |
4 | * This library is free software; you can redistribute it and/or |
5 | * modify it under the terms of the GNU Library General Public |
6 | * License as published by the Free Software Foundation; either |
7 | * version 2 of the License, or (at your option) any later version. |
8 | * |
9 | * This library is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | * Library General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU Library General Public License |
15 | * along with this library; see the file COPYING.LIB. If not, write to |
16 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 | * Boston, MA 02110-1301, USA. |
18 | */ |
19 | |
20 | #include "config.h" |
21 | #include "WebKitDOMHTMLInputElement.h" |
22 | |
23 | #include <WebCore/CSSImportRule.h> |
24 | #include "DOMObjectCache.h" |
25 | #include <WebCore/DOMException.h> |
26 | #include <WebCore/Document.h> |
27 | #include "GObjectEventListener.h" |
28 | #include <WebCore/HTMLNames.h> |
29 | #include <WebCore/JSExecState.h> |
30 | #include "WebKitDOMEventPrivate.h" |
31 | #include "WebKitDOMEventTarget.h" |
32 | #include "WebKitDOMFileListPrivate.h" |
33 | #include "WebKitDOMHTMLElementPrivate.h" |
34 | #include "WebKitDOMHTMLFormElementPrivate.h" |
35 | #include "WebKitDOMHTMLInputElementPrivate.h" |
36 | #include "WebKitDOMNodeListPrivate.h" |
37 | #include "WebKitDOMNodePrivate.h" |
38 | #include "WebKitDOMPrivate.h" |
39 | #include "ConvertToUTF8String.h" |
40 | #include <wtf/GetPtr.h> |
41 | #include <wtf/RefPtr.h> |
42 | |
43 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS; |
44 | |
45 | namespace WebKit { |
46 | |
47 | WebKitDOMHTMLInputElement* kit(WebCore::HTMLInputElement* obj) |
48 | { |
49 | return WEBKIT_DOM_HTML_INPUT_ELEMENT(kit(static_cast<WebCore::Node*>(obj))); |
50 | } |
51 | |
52 | WebCore::HTMLInputElement* core(WebKitDOMHTMLInputElement* request) |
53 | { |
54 | return request ? static_cast<WebCore::HTMLInputElement*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0; |
55 | } |
56 | |
57 | WebKitDOMHTMLInputElement* wrapHTMLInputElement(WebCore::HTMLInputElement* coreObject) |
58 | { |
59 | ASSERT(coreObject); |
60 | return WEBKIT_DOM_HTML_INPUT_ELEMENT(g_object_new(WEBKIT_DOM_TYPE_HTML_INPUT_ELEMENT, "core-object" , coreObject, nullptr)); |
61 | } |
62 | |
63 | } // namespace WebKit |
64 | |
65 | static gboolean webkit_dom_html_input_element_dispatch_event(WebKitDOMEventTarget* target, WebKitDOMEvent* event, GError** error) |
66 | { |
67 | WebCore::Event* coreEvent = WebKit::core(event); |
68 | if (!coreEvent) |
69 | return false; |
70 | WebCore::HTMLInputElement* coreTarget = static_cast<WebCore::HTMLInputElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
71 | |
72 | auto result = coreTarget->dispatchEventForBindings(*coreEvent); |
73 | if (result.hasException()) { |
74 | auto description = WebCore::DOMException::description(result.releaseException().code()); |
75 | g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM" ), description.legacyCode, description.name); |
76 | return false; |
77 | } |
78 | return result.releaseReturnValue(); |
79 | } |
80 | |
81 | static gboolean webkit_dom_html_input_element_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
82 | { |
83 | WebCore::HTMLInputElement* coreTarget = static_cast<WebCore::HTMLInputElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
84 | return WebKit::GObjectEventListener::addEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture); |
85 | } |
86 | |
87 | static gboolean webkit_dom_html_input_element_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
88 | { |
89 | WebCore::HTMLInputElement* coreTarget = static_cast<WebCore::HTMLInputElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
90 | return WebKit::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture); |
91 | } |
92 | |
93 | static void webkit_dom_html_input_element_dom_event_target_init(WebKitDOMEventTargetIface* iface) |
94 | { |
95 | iface->dispatch_event = webkit_dom_html_input_element_dispatch_event; |
96 | iface->add_event_listener = webkit_dom_html_input_element_add_event_listener; |
97 | iface->remove_event_listener = webkit_dom_html_input_element_remove_event_listener; |
98 | } |
99 | |
100 | G_DEFINE_TYPE_WITH_CODE(WebKitDOMHTMLInputElement, webkit_dom_html_input_element, WEBKIT_DOM_TYPE_HTML_ELEMENT, G_IMPLEMENT_INTERFACE(WEBKIT_DOM_TYPE_EVENT_TARGET, webkit_dom_html_input_element_dom_event_target_init)) |
101 | |
102 | enum { |
103 | DOM_HTML_INPUT_ELEMENT_PROP_0, |
104 | DOM_HTML_INPUT_ELEMENT_PROP_ACCEPT, |
105 | DOM_HTML_INPUT_ELEMENT_PROP_ALT, |
106 | DOM_HTML_INPUT_ELEMENT_PROP_AUTOFOCUS, |
107 | DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_CHECKED, |
108 | DOM_HTML_INPUT_ELEMENT_PROP_CHECKED, |
109 | DOM_HTML_INPUT_ELEMENT_PROP_DISABLED, |
110 | DOM_HTML_INPUT_ELEMENT_PROP_FORM, |
111 | DOM_HTML_INPUT_ELEMENT_PROP_FILES, |
112 | DOM_HTML_INPUT_ELEMENT_PROP_HEIGHT, |
113 | DOM_HTML_INPUT_ELEMENT_PROP_INDETERMINATE, |
114 | DOM_HTML_INPUT_ELEMENT_PROP_MAX_LENGTH, |
115 | DOM_HTML_INPUT_ELEMENT_PROP_MULTIPLE, |
116 | DOM_HTML_INPUT_ELEMENT_PROP_NAME, |
117 | DOM_HTML_INPUT_ELEMENT_PROP_READ_ONLY, |
118 | DOM_HTML_INPUT_ELEMENT_PROP_SIZE, |
119 | DOM_HTML_INPUT_ELEMENT_PROP_SRC, |
120 | DOM_HTML_INPUT_ELEMENT_PROP_TYPE, |
121 | DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_VALUE, |
122 | DOM_HTML_INPUT_ELEMENT_PROP_VALUE, |
123 | DOM_HTML_INPUT_ELEMENT_PROP_WIDTH, |
124 | DOM_HTML_INPUT_ELEMENT_PROP_WILL_VALIDATE, |
125 | DOM_HTML_INPUT_ELEMENT_PROP_ALIGN, |
126 | DOM_HTML_INPUT_ELEMENT_PROP_USE_MAP, |
127 | DOM_HTML_INPUT_ELEMENT_PROP_CAPTURE, |
128 | }; |
129 | |
130 | static void webkit_dom_html_input_element_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec) |
131 | { |
132 | WebKitDOMHTMLInputElement* self = WEBKIT_DOM_HTML_INPUT_ELEMENT(object); |
133 | |
134 | switch (propertyId) { |
135 | case DOM_HTML_INPUT_ELEMENT_PROP_ACCEPT: |
136 | webkit_dom_html_input_element_set_accept(self, g_value_get_string(value)); |
137 | break; |
138 | case DOM_HTML_INPUT_ELEMENT_PROP_ALT: |
139 | webkit_dom_html_input_element_set_alt(self, g_value_get_string(value)); |
140 | break; |
141 | case DOM_HTML_INPUT_ELEMENT_PROP_AUTOFOCUS: |
142 | webkit_dom_html_input_element_set_autofocus(self, g_value_get_boolean(value)); |
143 | break; |
144 | case DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_CHECKED: |
145 | webkit_dom_html_input_element_set_default_checked(self, g_value_get_boolean(value)); |
146 | break; |
147 | case DOM_HTML_INPUT_ELEMENT_PROP_CHECKED: |
148 | webkit_dom_html_input_element_set_checked(self, g_value_get_boolean(value)); |
149 | break; |
150 | case DOM_HTML_INPUT_ELEMENT_PROP_DISABLED: |
151 | webkit_dom_html_input_element_set_disabled(self, g_value_get_boolean(value)); |
152 | break; |
153 | case DOM_HTML_INPUT_ELEMENT_PROP_HEIGHT: |
154 | webkit_dom_html_input_element_set_height(self, g_value_get_ulong(value)); |
155 | break; |
156 | case DOM_HTML_INPUT_ELEMENT_PROP_INDETERMINATE: |
157 | webkit_dom_html_input_element_set_indeterminate(self, g_value_get_boolean(value)); |
158 | break; |
159 | case DOM_HTML_INPUT_ELEMENT_PROP_MAX_LENGTH: |
160 | webkit_dom_html_input_element_set_max_length(self, g_value_get_long(value), nullptr); |
161 | break; |
162 | case DOM_HTML_INPUT_ELEMENT_PROP_MULTIPLE: |
163 | webkit_dom_html_input_element_set_multiple(self, g_value_get_boolean(value)); |
164 | break; |
165 | case DOM_HTML_INPUT_ELEMENT_PROP_NAME: |
166 | webkit_dom_html_input_element_set_name(self, g_value_get_string(value)); |
167 | break; |
168 | case DOM_HTML_INPUT_ELEMENT_PROP_READ_ONLY: |
169 | webkit_dom_html_input_element_set_read_only(self, g_value_get_boolean(value)); |
170 | break; |
171 | case DOM_HTML_INPUT_ELEMENT_PROP_SIZE: |
172 | webkit_dom_html_input_element_set_size(self, g_value_get_ulong(value), nullptr); |
173 | break; |
174 | case DOM_HTML_INPUT_ELEMENT_PROP_SRC: |
175 | webkit_dom_html_input_element_set_src(self, g_value_get_string(value)); |
176 | break; |
177 | case DOM_HTML_INPUT_ELEMENT_PROP_TYPE: |
178 | webkit_dom_html_input_element_set_input_type(self, g_value_get_string(value)); |
179 | break; |
180 | case DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_VALUE: |
181 | webkit_dom_html_input_element_set_default_value(self, g_value_get_string(value)); |
182 | break; |
183 | case DOM_HTML_INPUT_ELEMENT_PROP_VALUE: |
184 | webkit_dom_html_input_element_set_value(self, g_value_get_string(value)); |
185 | break; |
186 | case DOM_HTML_INPUT_ELEMENT_PROP_WIDTH: |
187 | webkit_dom_html_input_element_set_width(self, g_value_get_ulong(value)); |
188 | break; |
189 | case DOM_HTML_INPUT_ELEMENT_PROP_ALIGN: |
190 | webkit_dom_html_input_element_set_align(self, g_value_get_string(value)); |
191 | break; |
192 | case DOM_HTML_INPUT_ELEMENT_PROP_USE_MAP: |
193 | webkit_dom_html_input_element_set_use_map(self, g_value_get_string(value)); |
194 | break; |
195 | case DOM_HTML_INPUT_ELEMENT_PROP_CAPTURE: |
196 | webkit_dom_html_input_element_set_capture_type(self, g_value_get_string(value)); |
197 | break; |
198 | default: |
199 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
200 | break; |
201 | } |
202 | } |
203 | |
204 | static void webkit_dom_html_input_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) |
205 | { |
206 | WebKitDOMHTMLInputElement* self = WEBKIT_DOM_HTML_INPUT_ELEMENT(object); |
207 | |
208 | switch (propertyId) { |
209 | case DOM_HTML_INPUT_ELEMENT_PROP_ACCEPT: |
210 | g_value_take_string(value, webkit_dom_html_input_element_get_accept(self)); |
211 | break; |
212 | case DOM_HTML_INPUT_ELEMENT_PROP_ALT: |
213 | g_value_take_string(value, webkit_dom_html_input_element_get_alt(self)); |
214 | break; |
215 | case DOM_HTML_INPUT_ELEMENT_PROP_AUTOFOCUS: |
216 | g_value_set_boolean(value, webkit_dom_html_input_element_get_autofocus(self)); |
217 | break; |
218 | case DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_CHECKED: |
219 | g_value_set_boolean(value, webkit_dom_html_input_element_get_default_checked(self)); |
220 | break; |
221 | case DOM_HTML_INPUT_ELEMENT_PROP_CHECKED: |
222 | g_value_set_boolean(value, webkit_dom_html_input_element_get_checked(self)); |
223 | break; |
224 | case DOM_HTML_INPUT_ELEMENT_PROP_DISABLED: |
225 | g_value_set_boolean(value, webkit_dom_html_input_element_get_disabled(self)); |
226 | break; |
227 | case DOM_HTML_INPUT_ELEMENT_PROP_FORM: |
228 | g_value_set_object(value, webkit_dom_html_input_element_get_form(self)); |
229 | break; |
230 | case DOM_HTML_INPUT_ELEMENT_PROP_FILES: |
231 | g_value_set_object(value, webkit_dom_html_input_element_get_files(self)); |
232 | break; |
233 | case DOM_HTML_INPUT_ELEMENT_PROP_HEIGHT: |
234 | g_value_set_ulong(value, webkit_dom_html_input_element_get_height(self)); |
235 | break; |
236 | case DOM_HTML_INPUT_ELEMENT_PROP_INDETERMINATE: |
237 | g_value_set_boolean(value, webkit_dom_html_input_element_get_indeterminate(self)); |
238 | break; |
239 | case DOM_HTML_INPUT_ELEMENT_PROP_MAX_LENGTH: |
240 | g_value_set_long(value, webkit_dom_html_input_element_get_max_length(self)); |
241 | break; |
242 | case DOM_HTML_INPUT_ELEMENT_PROP_MULTIPLE: |
243 | g_value_set_boolean(value, webkit_dom_html_input_element_get_multiple(self)); |
244 | break; |
245 | case DOM_HTML_INPUT_ELEMENT_PROP_NAME: |
246 | g_value_take_string(value, webkit_dom_html_input_element_get_name(self)); |
247 | break; |
248 | case DOM_HTML_INPUT_ELEMENT_PROP_READ_ONLY: |
249 | g_value_set_boolean(value, webkit_dom_html_input_element_get_read_only(self)); |
250 | break; |
251 | case DOM_HTML_INPUT_ELEMENT_PROP_SIZE: |
252 | g_value_set_ulong(value, webkit_dom_html_input_element_get_size(self)); |
253 | break; |
254 | case DOM_HTML_INPUT_ELEMENT_PROP_SRC: |
255 | g_value_take_string(value, webkit_dom_html_input_element_get_src(self)); |
256 | break; |
257 | case DOM_HTML_INPUT_ELEMENT_PROP_TYPE: |
258 | g_value_take_string(value, webkit_dom_html_input_element_get_input_type(self)); |
259 | break; |
260 | case DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_VALUE: |
261 | g_value_take_string(value, webkit_dom_html_input_element_get_default_value(self)); |
262 | break; |
263 | case DOM_HTML_INPUT_ELEMENT_PROP_VALUE: |
264 | g_value_take_string(value, webkit_dom_html_input_element_get_value(self)); |
265 | break; |
266 | case DOM_HTML_INPUT_ELEMENT_PROP_WIDTH: |
267 | g_value_set_ulong(value, webkit_dom_html_input_element_get_width(self)); |
268 | break; |
269 | case DOM_HTML_INPUT_ELEMENT_PROP_WILL_VALIDATE: |
270 | g_value_set_boolean(value, webkit_dom_html_input_element_get_will_validate(self)); |
271 | break; |
272 | case DOM_HTML_INPUT_ELEMENT_PROP_ALIGN: |
273 | g_value_take_string(value, webkit_dom_html_input_element_get_align(self)); |
274 | break; |
275 | case DOM_HTML_INPUT_ELEMENT_PROP_USE_MAP: |
276 | g_value_take_string(value, webkit_dom_html_input_element_get_use_map(self)); |
277 | break; |
278 | case DOM_HTML_INPUT_ELEMENT_PROP_CAPTURE: |
279 | g_value_take_string(value, webkit_dom_html_input_element_get_capture_type(self)); |
280 | break; |
281 | default: |
282 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
283 | break; |
284 | } |
285 | } |
286 | |
287 | static void webkit_dom_html_input_element_class_init(WebKitDOMHTMLInputElementClass* requestClass) |
288 | { |
289 | GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass); |
290 | gobjectClass->set_property = webkit_dom_html_input_element_set_property; |
291 | gobjectClass->get_property = webkit_dom_html_input_element_get_property; |
292 | |
293 | g_object_class_install_property( |
294 | gobjectClass, |
295 | DOM_HTML_INPUT_ELEMENT_PROP_ACCEPT, |
296 | g_param_spec_string( |
297 | "accept" , |
298 | "HTMLInputElement:accept" , |
299 | "read-write gchar* HTMLInputElement:accept" , |
300 | "" , |
301 | WEBKIT_PARAM_READWRITE)); |
302 | |
303 | g_object_class_install_property( |
304 | gobjectClass, |
305 | DOM_HTML_INPUT_ELEMENT_PROP_ALT, |
306 | g_param_spec_string( |
307 | "alt" , |
308 | "HTMLInputElement:alt" , |
309 | "read-write gchar* HTMLInputElement:alt" , |
310 | "" , |
311 | WEBKIT_PARAM_READWRITE)); |
312 | |
313 | g_object_class_install_property( |
314 | gobjectClass, |
315 | DOM_HTML_INPUT_ELEMENT_PROP_AUTOFOCUS, |
316 | g_param_spec_boolean( |
317 | "autofocus" , |
318 | "HTMLInputElement:autofocus" , |
319 | "read-write gboolean HTMLInputElement:autofocus" , |
320 | FALSE, |
321 | WEBKIT_PARAM_READWRITE)); |
322 | |
323 | g_object_class_install_property( |
324 | gobjectClass, |
325 | DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_CHECKED, |
326 | g_param_spec_boolean( |
327 | "default-checked" , |
328 | "HTMLInputElement:default-checked" , |
329 | "read-write gboolean HTMLInputElement:default-checked" , |
330 | FALSE, |
331 | WEBKIT_PARAM_READWRITE)); |
332 | |
333 | g_object_class_install_property( |
334 | gobjectClass, |
335 | DOM_HTML_INPUT_ELEMENT_PROP_CHECKED, |
336 | g_param_spec_boolean( |
337 | "checked" , |
338 | "HTMLInputElement:checked" , |
339 | "read-write gboolean HTMLInputElement:checked" , |
340 | FALSE, |
341 | WEBKIT_PARAM_READWRITE)); |
342 | |
343 | g_object_class_install_property( |
344 | gobjectClass, |
345 | DOM_HTML_INPUT_ELEMENT_PROP_DISABLED, |
346 | g_param_spec_boolean( |
347 | "disabled" , |
348 | "HTMLInputElement:disabled" , |
349 | "read-write gboolean HTMLInputElement:disabled" , |
350 | FALSE, |
351 | WEBKIT_PARAM_READWRITE)); |
352 | |
353 | g_object_class_install_property( |
354 | gobjectClass, |
355 | DOM_HTML_INPUT_ELEMENT_PROP_FORM, |
356 | g_param_spec_object( |
357 | "form" , |
358 | "HTMLInputElement:form" , |
359 | "read-only WebKitDOMHTMLFormElement* HTMLInputElement:form" , |
360 | WEBKIT_DOM_TYPE_HTML_FORM_ELEMENT, |
361 | WEBKIT_PARAM_READABLE)); |
362 | |
363 | g_object_class_install_property( |
364 | gobjectClass, |
365 | DOM_HTML_INPUT_ELEMENT_PROP_FILES, |
366 | g_param_spec_object( |
367 | "files" , |
368 | "HTMLInputElement:files" , |
369 | "read-only WebKitDOMFileList* HTMLInputElement:files" , |
370 | WEBKIT_DOM_TYPE_FILE_LIST, |
371 | WEBKIT_PARAM_READABLE)); |
372 | |
373 | g_object_class_install_property( |
374 | gobjectClass, |
375 | DOM_HTML_INPUT_ELEMENT_PROP_HEIGHT, |
376 | g_param_spec_ulong( |
377 | "height" , |
378 | "HTMLInputElement:height" , |
379 | "read-write gulong HTMLInputElement:height" , |
380 | 0, G_MAXULONG, 0, |
381 | WEBKIT_PARAM_READWRITE)); |
382 | |
383 | g_object_class_install_property( |
384 | gobjectClass, |
385 | DOM_HTML_INPUT_ELEMENT_PROP_INDETERMINATE, |
386 | g_param_spec_boolean( |
387 | "indeterminate" , |
388 | "HTMLInputElement:indeterminate" , |
389 | "read-write gboolean HTMLInputElement:indeterminate" , |
390 | FALSE, |
391 | WEBKIT_PARAM_READWRITE)); |
392 | |
393 | g_object_class_install_property( |
394 | gobjectClass, |
395 | DOM_HTML_INPUT_ELEMENT_PROP_MAX_LENGTH, |
396 | g_param_spec_long( |
397 | "max-length" , |
398 | "HTMLInputElement:max-length" , |
399 | "read-write glong HTMLInputElement:max-length" , |
400 | G_MINLONG, G_MAXLONG, 0, |
401 | WEBKIT_PARAM_READWRITE)); |
402 | |
403 | g_object_class_install_property( |
404 | gobjectClass, |
405 | DOM_HTML_INPUT_ELEMENT_PROP_MULTIPLE, |
406 | g_param_spec_boolean( |
407 | "multiple" , |
408 | "HTMLInputElement:multiple" , |
409 | "read-write gboolean HTMLInputElement:multiple" , |
410 | FALSE, |
411 | WEBKIT_PARAM_READWRITE)); |
412 | |
413 | g_object_class_install_property( |
414 | gobjectClass, |
415 | DOM_HTML_INPUT_ELEMENT_PROP_NAME, |
416 | g_param_spec_string( |
417 | "name" , |
418 | "HTMLInputElement:name" , |
419 | "read-write gchar* HTMLInputElement:name" , |
420 | "" , |
421 | WEBKIT_PARAM_READWRITE)); |
422 | |
423 | g_object_class_install_property( |
424 | gobjectClass, |
425 | DOM_HTML_INPUT_ELEMENT_PROP_READ_ONLY, |
426 | g_param_spec_boolean( |
427 | "read-only" , |
428 | "HTMLInputElement:read-only" , |
429 | "read-write gboolean HTMLInputElement:read-only" , |
430 | FALSE, |
431 | WEBKIT_PARAM_READWRITE)); |
432 | |
433 | g_object_class_install_property( |
434 | gobjectClass, |
435 | DOM_HTML_INPUT_ELEMENT_PROP_SIZE, |
436 | g_param_spec_ulong( |
437 | "size" , |
438 | "HTMLInputElement:size" , |
439 | "read-write gulong HTMLInputElement:size" , |
440 | 0, G_MAXULONG, 0, |
441 | WEBKIT_PARAM_READWRITE)); |
442 | |
443 | g_object_class_install_property( |
444 | gobjectClass, |
445 | DOM_HTML_INPUT_ELEMENT_PROP_SRC, |
446 | g_param_spec_string( |
447 | "src" , |
448 | "HTMLInputElement:src" , |
449 | "read-write gchar* HTMLInputElement:src" , |
450 | "" , |
451 | WEBKIT_PARAM_READWRITE)); |
452 | |
453 | g_object_class_install_property( |
454 | gobjectClass, |
455 | DOM_HTML_INPUT_ELEMENT_PROP_TYPE, |
456 | g_param_spec_string( |
457 | "type" , |
458 | "HTMLInputElement:type" , |
459 | "read-write gchar* HTMLInputElement:type" , |
460 | "" , |
461 | WEBKIT_PARAM_READWRITE)); |
462 | |
463 | g_object_class_install_property( |
464 | gobjectClass, |
465 | DOM_HTML_INPUT_ELEMENT_PROP_DEFAULT_VALUE, |
466 | g_param_spec_string( |
467 | "default-value" , |
468 | "HTMLInputElement:default-value" , |
469 | "read-write gchar* HTMLInputElement:default-value" , |
470 | "" , |
471 | WEBKIT_PARAM_READWRITE)); |
472 | |
473 | g_object_class_install_property( |
474 | gobjectClass, |
475 | DOM_HTML_INPUT_ELEMENT_PROP_VALUE, |
476 | g_param_spec_string( |
477 | "value" , |
478 | "HTMLInputElement:value" , |
479 | "read-write gchar* HTMLInputElement:value" , |
480 | "" , |
481 | WEBKIT_PARAM_READWRITE)); |
482 | |
483 | g_object_class_install_property( |
484 | gobjectClass, |
485 | DOM_HTML_INPUT_ELEMENT_PROP_WIDTH, |
486 | g_param_spec_ulong( |
487 | "width" , |
488 | "HTMLInputElement:width" , |
489 | "read-write gulong HTMLInputElement:width" , |
490 | 0, G_MAXULONG, 0, |
491 | WEBKIT_PARAM_READWRITE)); |
492 | |
493 | g_object_class_install_property( |
494 | gobjectClass, |
495 | DOM_HTML_INPUT_ELEMENT_PROP_WILL_VALIDATE, |
496 | g_param_spec_boolean( |
497 | "will-validate" , |
498 | "HTMLInputElement:will-validate" , |
499 | "read-only gboolean HTMLInputElement:will-validate" , |
500 | FALSE, |
501 | WEBKIT_PARAM_READABLE)); |
502 | |
503 | g_object_class_install_property( |
504 | gobjectClass, |
505 | DOM_HTML_INPUT_ELEMENT_PROP_ALIGN, |
506 | g_param_spec_string( |
507 | "align" , |
508 | "HTMLInputElement:align" , |
509 | "read-write gchar* HTMLInputElement:align" , |
510 | "" , |
511 | WEBKIT_PARAM_READWRITE)); |
512 | |
513 | g_object_class_install_property( |
514 | gobjectClass, |
515 | DOM_HTML_INPUT_ELEMENT_PROP_USE_MAP, |
516 | g_param_spec_string( |
517 | "use-map" , |
518 | "HTMLInputElement:use-map" , |
519 | "read-write gchar* HTMLInputElement:use-map" , |
520 | "" , |
521 | WEBKIT_PARAM_READWRITE)); |
522 | |
523 | g_object_class_install_property( |
524 | gobjectClass, |
525 | DOM_HTML_INPUT_ELEMENT_PROP_CAPTURE, |
526 | g_param_spec_string( |
527 | "capture" , |
528 | "HTMLInputElement:capture" , |
529 | "read-write gchar* HTMLInputElement:capture" , |
530 | "" , |
531 | WEBKIT_PARAM_READWRITE)); |
532 | |
533 | } |
534 | |
535 | static void webkit_dom_html_input_element_init(WebKitDOMHTMLInputElement* request) |
536 | { |
537 | UNUSED_PARAM(request); |
538 | } |
539 | |
540 | void webkit_dom_html_input_element_select(WebKitDOMHTMLInputElement* self) |
541 | { |
542 | WebCore::JSMainThreadNullState state; |
543 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
544 | WebCore::HTMLInputElement* item = WebKit::core(self); |
545 | item->select(); |
546 | } |
547 | |
548 | gchar* webkit_dom_html_input_element_get_accept(WebKitDOMHTMLInputElement* self) |
549 | { |
550 | WebCore::JSMainThreadNullState state; |
551 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
552 | WebCore::HTMLInputElement* item = WebKit::core(self); |
553 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::acceptAttr)); |
554 | return result; |
555 | } |
556 | |
557 | void webkit_dom_html_input_element_set_accept(WebKitDOMHTMLInputElement* self, const gchar* value) |
558 | { |
559 | WebCore::JSMainThreadNullState state; |
560 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
561 | g_return_if_fail(value); |
562 | WebCore::HTMLInputElement* item = WebKit::core(self); |
563 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
564 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::acceptAttr, convertedValue); |
565 | } |
566 | |
567 | gchar* webkit_dom_html_input_element_get_alt(WebKitDOMHTMLInputElement* self) |
568 | { |
569 | WebCore::JSMainThreadNullState state; |
570 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
571 | WebCore::HTMLInputElement* item = WebKit::core(self); |
572 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::altAttr)); |
573 | return result; |
574 | } |
575 | |
576 | void webkit_dom_html_input_element_set_alt(WebKitDOMHTMLInputElement* self, const gchar* value) |
577 | { |
578 | WebCore::JSMainThreadNullState state; |
579 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
580 | g_return_if_fail(value); |
581 | WebCore::HTMLInputElement* item = WebKit::core(self); |
582 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
583 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::altAttr, convertedValue); |
584 | } |
585 | |
586 | gboolean webkit_dom_html_input_element_get_autofocus(WebKitDOMHTMLInputElement* self) |
587 | { |
588 | WebCore::JSMainThreadNullState state; |
589 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
590 | WebCore::HTMLInputElement* item = WebKit::core(self); |
591 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::autofocusAttr); |
592 | return result; |
593 | } |
594 | |
595 | void webkit_dom_html_input_element_set_autofocus(WebKitDOMHTMLInputElement* self, gboolean value) |
596 | { |
597 | WebCore::JSMainThreadNullState state; |
598 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
599 | WebCore::HTMLInputElement* item = WebKit::core(self); |
600 | item->setBooleanAttribute(WebCore::HTMLNames::autofocusAttr, value); |
601 | } |
602 | |
603 | gboolean webkit_dom_html_input_element_get_default_checked(WebKitDOMHTMLInputElement* self) |
604 | { |
605 | WebCore::JSMainThreadNullState state; |
606 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
607 | WebCore::HTMLInputElement* item = WebKit::core(self); |
608 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::checkedAttr); |
609 | return result; |
610 | } |
611 | |
612 | void webkit_dom_html_input_element_set_default_checked(WebKitDOMHTMLInputElement* self, gboolean value) |
613 | { |
614 | WebCore::JSMainThreadNullState state; |
615 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
616 | WebCore::HTMLInputElement* item = WebKit::core(self); |
617 | item->setBooleanAttribute(WebCore::HTMLNames::checkedAttr, value); |
618 | } |
619 | |
620 | gboolean webkit_dom_html_input_element_get_checked(WebKitDOMHTMLInputElement* self) |
621 | { |
622 | WebCore::JSMainThreadNullState state; |
623 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
624 | WebCore::HTMLInputElement* item = WebKit::core(self); |
625 | gboolean result = item->checked(); |
626 | return result; |
627 | } |
628 | |
629 | void webkit_dom_html_input_element_set_checked(WebKitDOMHTMLInputElement* self, gboolean value) |
630 | { |
631 | WebCore::JSMainThreadNullState state; |
632 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
633 | WebCore::HTMLInputElement* item = WebKit::core(self); |
634 | item->setChecked(value); |
635 | } |
636 | |
637 | gboolean webkit_dom_html_input_element_get_disabled(WebKitDOMHTMLInputElement* self) |
638 | { |
639 | WebCore::JSMainThreadNullState state; |
640 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
641 | WebCore::HTMLInputElement* item = WebKit::core(self); |
642 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::disabledAttr); |
643 | return result; |
644 | } |
645 | |
646 | void webkit_dom_html_input_element_set_disabled(WebKitDOMHTMLInputElement* self, gboolean value) |
647 | { |
648 | WebCore::JSMainThreadNullState state; |
649 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
650 | WebCore::HTMLInputElement* item = WebKit::core(self); |
651 | item->setBooleanAttribute(WebCore::HTMLNames::disabledAttr, value); |
652 | } |
653 | |
654 | WebKitDOMHTMLFormElement* webkit_dom_html_input_element_get_form(WebKitDOMHTMLInputElement* self) |
655 | { |
656 | WebCore::JSMainThreadNullState state; |
657 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
658 | WebCore::HTMLInputElement* item = WebKit::core(self); |
659 | RefPtr<WebCore::HTMLFormElement> gobjectResult = WTF::getPtr(item->form()); |
660 | return WebKit::kit(gobjectResult.get()); |
661 | } |
662 | |
663 | WebKitDOMFileList* webkit_dom_html_input_element_get_files(WebKitDOMHTMLInputElement* self) |
664 | { |
665 | WebCore::JSMainThreadNullState state; |
666 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
667 | WebCore::HTMLInputElement* item = WebKit::core(self); |
668 | RefPtr<WebCore::FileList> gobjectResult = WTF::getPtr(item->files()); |
669 | return WebKit::kit(gobjectResult.get()); |
670 | } |
671 | |
672 | void webkit_dom_html_input_element_set_files(WebKitDOMHTMLInputElement* self, WebKitDOMFileList* value) |
673 | { |
674 | WebCore::JSMainThreadNullState state; |
675 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
676 | g_return_if_fail(WEBKIT_DOM_IS_FILE_LIST(value)); |
677 | WebCore::HTMLInputElement* item = WebKit::core(self); |
678 | WebCore::FileList* convertedValue = WebKit::core(value); |
679 | item->setFiles(convertedValue); |
680 | } |
681 | |
682 | gulong webkit_dom_html_input_element_get_height(WebKitDOMHTMLInputElement* self) |
683 | { |
684 | WebCore::JSMainThreadNullState state; |
685 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
686 | WebCore::HTMLInputElement* item = WebKit::core(self); |
687 | gulong result = item->height(); |
688 | return result; |
689 | } |
690 | |
691 | void webkit_dom_html_input_element_set_height(WebKitDOMHTMLInputElement* self, gulong value) |
692 | { |
693 | WebCore::JSMainThreadNullState state; |
694 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
695 | WebCore::HTMLInputElement* item = WebKit::core(self); |
696 | item->setHeight(value); |
697 | } |
698 | |
699 | gboolean webkit_dom_html_input_element_get_indeterminate(WebKitDOMHTMLInputElement* self) |
700 | { |
701 | WebCore::JSMainThreadNullState state; |
702 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
703 | WebCore::HTMLInputElement* item = WebKit::core(self); |
704 | gboolean result = item->indeterminate(); |
705 | return result; |
706 | } |
707 | |
708 | void webkit_dom_html_input_element_set_indeterminate(WebKitDOMHTMLInputElement* self, gboolean value) |
709 | { |
710 | WebCore::JSMainThreadNullState state; |
711 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
712 | WebCore::HTMLInputElement* item = WebKit::core(self); |
713 | item->setIndeterminate(value); |
714 | } |
715 | |
716 | glong webkit_dom_html_input_element_get_max_length(WebKitDOMHTMLInputElement* self) |
717 | { |
718 | WebCore::JSMainThreadNullState state; |
719 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
720 | WebCore::HTMLInputElement* item = WebKit::core(self); |
721 | glong result = item->maxLength(); |
722 | return result; |
723 | } |
724 | |
725 | void webkit_dom_html_input_element_set_max_length(WebKitDOMHTMLInputElement* self, glong value, GError** error) |
726 | { |
727 | WebCore::JSMainThreadNullState state; |
728 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
729 | g_return_if_fail(!error || !*error); |
730 | WebCore::HTMLInputElement* item = WebKit::core(self); |
731 | auto result = item->setMaxLength(value); |
732 | if (result.hasException()) { |
733 | auto description = WebCore::DOMException::description(result.releaseException().code()); |
734 | g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM" ), description.legacyCode, description.name); |
735 | } |
736 | } |
737 | |
738 | gboolean webkit_dom_html_input_element_get_multiple(WebKitDOMHTMLInputElement* self) |
739 | { |
740 | WebCore::JSMainThreadNullState state; |
741 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
742 | WebCore::HTMLInputElement* item = WebKit::core(self); |
743 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::multipleAttr); |
744 | return result; |
745 | } |
746 | |
747 | void webkit_dom_html_input_element_set_multiple(WebKitDOMHTMLInputElement* self, gboolean value) |
748 | { |
749 | WebCore::JSMainThreadNullState state; |
750 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
751 | WebCore::HTMLInputElement* item = WebKit::core(self); |
752 | item->setBooleanAttribute(WebCore::HTMLNames::multipleAttr, value); |
753 | } |
754 | |
755 | gchar* webkit_dom_html_input_element_get_name(WebKitDOMHTMLInputElement* self) |
756 | { |
757 | WebCore::JSMainThreadNullState state; |
758 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
759 | WebCore::HTMLInputElement* item = WebKit::core(self); |
760 | gchar* result = convertToUTF8String(item->getNameAttribute()); |
761 | return result; |
762 | } |
763 | |
764 | void webkit_dom_html_input_element_set_name(WebKitDOMHTMLInputElement* self, const gchar* value) |
765 | { |
766 | WebCore::JSMainThreadNullState state; |
767 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
768 | g_return_if_fail(value); |
769 | WebCore::HTMLInputElement* item = WebKit::core(self); |
770 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
771 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, convertedValue); |
772 | } |
773 | |
774 | gboolean webkit_dom_html_input_element_get_read_only(WebKitDOMHTMLInputElement* self) |
775 | { |
776 | WebCore::JSMainThreadNullState state; |
777 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
778 | WebCore::HTMLInputElement* item = WebKit::core(self); |
779 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::readonlyAttr); |
780 | return result; |
781 | } |
782 | |
783 | void webkit_dom_html_input_element_set_read_only(WebKitDOMHTMLInputElement* self, gboolean value) |
784 | { |
785 | WebCore::JSMainThreadNullState state; |
786 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
787 | WebCore::HTMLInputElement* item = WebKit::core(self); |
788 | item->setBooleanAttribute(WebCore::HTMLNames::readonlyAttr, value); |
789 | } |
790 | |
791 | gulong webkit_dom_html_input_element_get_size(WebKitDOMHTMLInputElement* self) |
792 | { |
793 | WebCore::JSMainThreadNullState state; |
794 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
795 | WebCore::HTMLInputElement* item = WebKit::core(self); |
796 | gulong result = item->size(); |
797 | return result; |
798 | } |
799 | |
800 | void webkit_dom_html_input_element_set_size(WebKitDOMHTMLInputElement* self, gulong value, GError** error) |
801 | { |
802 | WebCore::JSMainThreadNullState state; |
803 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
804 | g_return_if_fail(!error || !*error); |
805 | WebCore::HTMLInputElement* item = WebKit::core(self); |
806 | auto result = item->setSize(value); |
807 | if (result.hasException()) { |
808 | auto description = WebCore::DOMException::description(result.releaseException().code()); |
809 | g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM" ), description.legacyCode, description.name); |
810 | } |
811 | } |
812 | |
813 | gchar* webkit_dom_html_input_element_get_src(WebKitDOMHTMLInputElement* self) |
814 | { |
815 | WebCore::JSMainThreadNullState state; |
816 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
817 | WebCore::HTMLInputElement* item = WebKit::core(self); |
818 | gchar* result = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::srcAttr)); |
819 | return result; |
820 | } |
821 | |
822 | void webkit_dom_html_input_element_set_src(WebKitDOMHTMLInputElement* self, const gchar* value) |
823 | { |
824 | WebCore::JSMainThreadNullState state; |
825 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
826 | g_return_if_fail(value); |
827 | WebCore::HTMLInputElement* item = WebKit::core(self); |
828 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
829 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, convertedValue); |
830 | } |
831 | |
832 | gchar* webkit_dom_html_input_element_get_input_type(WebKitDOMHTMLInputElement* self) |
833 | { |
834 | WebCore::JSMainThreadNullState state; |
835 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
836 | WebCore::HTMLInputElement* item = WebKit::core(self); |
837 | gchar* result = convertToUTF8String(item->type()); |
838 | return result; |
839 | } |
840 | |
841 | void webkit_dom_html_input_element_set_input_type(WebKitDOMHTMLInputElement* self, const gchar* value) |
842 | { |
843 | WebCore::JSMainThreadNullState state; |
844 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
845 | g_return_if_fail(value); |
846 | WebCore::HTMLInputElement* item = WebKit::core(self); |
847 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
848 | item->setType(convertedValue); |
849 | } |
850 | |
851 | gchar* webkit_dom_html_input_element_get_default_value(WebKitDOMHTMLInputElement* self) |
852 | { |
853 | WebCore::JSMainThreadNullState state; |
854 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
855 | WebCore::HTMLInputElement* item = WebKit::core(self); |
856 | gchar* result = convertToUTF8String(item->defaultValue()); |
857 | return result; |
858 | } |
859 | |
860 | void webkit_dom_html_input_element_set_default_value(WebKitDOMHTMLInputElement* self, const gchar* value) |
861 | { |
862 | WebCore::JSMainThreadNullState state; |
863 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
864 | g_return_if_fail(value); |
865 | WebCore::HTMLInputElement* item = WebKit::core(self); |
866 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
867 | item->setDefaultValue(convertedValue); |
868 | } |
869 | |
870 | gchar* webkit_dom_html_input_element_get_value(WebKitDOMHTMLInputElement* self) |
871 | { |
872 | WebCore::JSMainThreadNullState state; |
873 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
874 | WebCore::HTMLInputElement* item = WebKit::core(self); |
875 | gchar* result = convertToUTF8String(item->value()); |
876 | return result; |
877 | } |
878 | |
879 | void webkit_dom_html_input_element_set_value(WebKitDOMHTMLInputElement* self, const gchar* value) |
880 | { |
881 | WebCore::JSMainThreadNullState state; |
882 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
883 | g_return_if_fail(value); |
884 | WebCore::HTMLInputElement* item = WebKit::core(self); |
885 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
886 | item->setValue(convertedValue); |
887 | } |
888 | |
889 | gulong webkit_dom_html_input_element_get_width(WebKitDOMHTMLInputElement* self) |
890 | { |
891 | WebCore::JSMainThreadNullState state; |
892 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
893 | WebCore::HTMLInputElement* item = WebKit::core(self); |
894 | gulong result = item->width(); |
895 | return result; |
896 | } |
897 | |
898 | void webkit_dom_html_input_element_set_width(WebKitDOMHTMLInputElement* self, gulong value) |
899 | { |
900 | WebCore::JSMainThreadNullState state; |
901 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
902 | WebCore::HTMLInputElement* item = WebKit::core(self); |
903 | item->setWidth(value); |
904 | } |
905 | |
906 | gboolean webkit_dom_html_input_element_get_will_validate(WebKitDOMHTMLInputElement* self) |
907 | { |
908 | WebCore::JSMainThreadNullState state; |
909 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
910 | WebCore::HTMLInputElement* item = WebKit::core(self); |
911 | gboolean result = item->willValidate(); |
912 | return result; |
913 | } |
914 | |
915 | gchar* webkit_dom_html_input_element_get_align(WebKitDOMHTMLInputElement* self) |
916 | { |
917 | WebCore::JSMainThreadNullState state; |
918 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
919 | WebCore::HTMLInputElement* item = WebKit::core(self); |
920 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr)); |
921 | return result; |
922 | } |
923 | |
924 | void webkit_dom_html_input_element_set_align(WebKitDOMHTMLInputElement* self, const gchar* value) |
925 | { |
926 | WebCore::JSMainThreadNullState state; |
927 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
928 | g_return_if_fail(value); |
929 | WebCore::HTMLInputElement* item = WebKit::core(self); |
930 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
931 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, convertedValue); |
932 | } |
933 | |
934 | gchar* webkit_dom_html_input_element_get_use_map(WebKitDOMHTMLInputElement* self) |
935 | { |
936 | WebCore::JSMainThreadNullState state; |
937 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
938 | WebCore::HTMLInputElement* item = WebKit::core(self); |
939 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr)); |
940 | return result; |
941 | } |
942 | |
943 | void webkit_dom_html_input_element_set_use_map(WebKitDOMHTMLInputElement* self, const gchar* value) |
944 | { |
945 | WebCore::JSMainThreadNullState state; |
946 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
947 | g_return_if_fail(value); |
948 | WebCore::HTMLInputElement* item = WebKit::core(self); |
949 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
950 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr, convertedValue); |
951 | } |
952 | |
953 | gchar* webkit_dom_html_input_element_get_capture_type(WebKitDOMHTMLInputElement* self) |
954 | { |
955 | #if ENABLE(MEDIA_CAPTURE) |
956 | WebCore::JSMainThreadNullState state; |
957 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), 0); |
958 | WebCore::HTMLInputElement* item = WebKit::core(self); |
959 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::captureAttr)); |
960 | return result; |
961 | #else |
962 | UNUSED_PARAM(self); |
963 | WEBKIT_WARN_FEATURE_NOT_PRESENT("Media Capture" ) |
964 | return 0; |
965 | #endif /* ENABLE(MEDIA_CAPTURE) */ |
966 | } |
967 | |
968 | void webkit_dom_html_input_element_set_capture_type(WebKitDOMHTMLInputElement* self, const gchar* value) |
969 | { |
970 | #if ENABLE(MEDIA_CAPTURE) |
971 | WebCore::JSMainThreadNullState state; |
972 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
973 | g_return_if_fail(value); |
974 | WebCore::HTMLInputElement* item = WebKit::core(self); |
975 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
976 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::captureAttr, convertedValue); |
977 | #else |
978 | UNUSED_PARAM(self); |
979 | UNUSED_PARAM(value); |
980 | WEBKIT_WARN_FEATURE_NOT_PRESENT("Media Capture" ) |
981 | #endif /* ENABLE(MEDIA_CAPTURE) */ |
982 | } |
983 | |
984 | gboolean webkit_dom_html_input_element_is_edited(WebKitDOMHTMLInputElement* input) |
985 | { |
986 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(input), FALSE); |
987 | |
988 | return WebKit::core(input)->lastChangeWasUserEdit(); |
989 | } |
990 | |
991 | gboolean webkit_dom_html_input_element_get_auto_filled(WebKitDOMHTMLInputElement* self) |
992 | { |
993 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self), FALSE); |
994 | |
995 | return WebKit::core(self)->isAutoFilled(); |
996 | } |
997 | |
998 | void webkit_dom_html_input_element_set_auto_filled(WebKitDOMHTMLInputElement* self, gboolean value) |
999 | { |
1000 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
1001 | |
1002 | WebKit::core(self)->setAutoFilled(value); |
1003 | } |
1004 | |
1005 | void webkit_dom_html_input_element_set_editing_value(WebKitDOMHTMLInputElement* self, const gchar* value) |
1006 | { |
1007 | g_return_if_fail(WEBKIT_DOM_IS_HTML_INPUT_ELEMENT(self)); |
1008 | g_return_if_fail(value); |
1009 | |
1010 | WebKit::core(self)->setValueForUser(WTF::String::fromUTF8(value)); |
1011 | } |
1012 | G_GNUC_END_IGNORE_DEPRECATIONS; |
1013 | |