24d73143d98415784389da42bdd6b93454caba8a
[WebKit-https.git] / Source / WebKit / WebProcess / InjectedBundle / API / gtk / DOM / WebKitDOMHTMLObjectElement.cpp
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 "WebKitDOMHTMLObjectElement.h"
22
23 #include <WebCore/CSSImportRule.h>
24 #include "DOMObjectCache.h"
25 #include <WebCore/Document.h>
26 #include <WebCore/ExceptionCode.h>
27 #include <WebCore/ExceptionCodeDescription.h>
28 #include "GObjectEventListener.h"
29 #include <WebCore/HTMLNames.h>
30 #include <WebCore/JSMainThreadExecState.h>
31 #include "WebKitDOMDocumentPrivate.h"
32 #include "WebKitDOMEventPrivate.h"
33 #include "WebKitDOMEventTarget.h"
34 #include "WebKitDOMHTMLFormElementPrivate.h"
35 #include "WebKitDOMHTMLObjectElementPrivate.h"
36 #include "WebKitDOMNodePrivate.h"
37 #include "WebKitDOMPrivate.h"
38 #include "ConvertToUTF8String.h"
39 #include <wtf/GetPtr.h>
40 #include <wtf/RefPtr.h>
41
42 namespace WebKit {
43
44 WebKitDOMHTMLObjectElement* kit(WebCore::HTMLObjectElement* obj)
45 {
46     return WEBKIT_DOM_HTML_OBJECT_ELEMENT(kit(static_cast<WebCore::Node*>(obj)));
47 }
48
49 WebCore::HTMLObjectElement* core(WebKitDOMHTMLObjectElement* request)
50 {
51     return request ? static_cast<WebCore::HTMLObjectElement*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0;
52 }
53
54 WebKitDOMHTMLObjectElement* wrapHTMLObjectElement(WebCore::HTMLObjectElement* coreObject)
55 {
56     ASSERT(coreObject);
57     return WEBKIT_DOM_HTML_OBJECT_ELEMENT(g_object_new(WEBKIT_DOM_TYPE_HTML_OBJECT_ELEMENT, "core-object", coreObject, nullptr));
58 }
59
60 } // namespace WebKit
61
62 static gboolean webkit_dom_html_object_element_dispatch_event(WebKitDOMEventTarget* target, WebKitDOMEvent* event, GError** error)
63 {
64     WebCore::Event* coreEvent = WebKit::core(event);
65     if (!coreEvent)
66         return false;
67     WebCore::HTMLObjectElement* coreTarget = static_cast<WebCore::HTMLObjectElement*>(WEBKIT_DOM_OBJECT(target)->coreObject);
68
69     auto result = coreTarget->dispatchEventForBindings(*coreEvent);
70     if (result.hasException()) {
71         WebCore::ExceptionCodeDescription description(result.releaseException().code());
72         g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), description.code, description.name);
73         return false;
74     }
75     return result.releaseReturnValue();
76 }
77
78 static gboolean webkit_dom_html_object_element_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture)
79 {
80     WebCore::HTMLObjectElement* coreTarget = static_cast<WebCore::HTMLObjectElement*>(WEBKIT_DOM_OBJECT(target)->coreObject);
81     return WebKit::GObjectEventListener::addEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture);
82 }
83
84 static gboolean webkit_dom_html_object_element_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture)
85 {
86     WebCore::HTMLObjectElement* coreTarget = static_cast<WebCore::HTMLObjectElement*>(WEBKIT_DOM_OBJECT(target)->coreObject);
87     return WebKit::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture);
88 }
89
90 static void webkit_dom_event_target_init(WebKitDOMEventTargetIface* iface)
91 {
92     iface->dispatch_event = webkit_dom_html_object_element_dispatch_event;
93     iface->add_event_listener = webkit_dom_html_object_element_add_event_listener;
94     iface->remove_event_listener = webkit_dom_html_object_element_remove_event_listener;
95 }
96
97 G_DEFINE_TYPE_WITH_CODE(WebKitDOMHTMLObjectElement, webkit_dom_html_object_element, WEBKIT_DOM_TYPE_HTML_ELEMENT, G_IMPLEMENT_INTERFACE(WEBKIT_DOM_TYPE_EVENT_TARGET, webkit_dom_event_target_init))
98
99 enum {
100     PROP_0,
101     PROP_FORM,
102     PROP_CODE,
103     PROP_ALIGN,
104     PROP_ARCHIVE,
105     PROP_BORDER,
106     PROP_CODE_BASE,
107     PROP_CODE_TYPE,
108     PROP_DATA,
109     PROP_DECLARE,
110     PROP_HEIGHT,
111     PROP_HSPACE,
112     PROP_NAME,
113     PROP_STANDBY,
114     PROP_TYPE,
115     PROP_USE_MAP,
116     PROP_VSPACE,
117     PROP_WIDTH,
118     PROP_CONTENT_DOCUMENT,
119 };
120
121 static void webkit_dom_html_object_element_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
122 {
123     WebKitDOMHTMLObjectElement* self = WEBKIT_DOM_HTML_OBJECT_ELEMENT(object);
124
125     switch (propertyId) {
126     case PROP_CODE:
127         webkit_dom_html_object_element_set_code(self, g_value_get_string(value));
128         break;
129     case PROP_ALIGN:
130         webkit_dom_html_object_element_set_align(self, g_value_get_string(value));
131         break;
132     case PROP_ARCHIVE:
133         webkit_dom_html_object_element_set_archive(self, g_value_get_string(value));
134         break;
135     case PROP_BORDER:
136         webkit_dom_html_object_element_set_border(self, g_value_get_string(value));
137         break;
138     case PROP_CODE_BASE:
139         webkit_dom_html_object_element_set_code_base(self, g_value_get_string(value));
140         break;
141     case PROP_CODE_TYPE:
142         webkit_dom_html_object_element_set_code_type(self, g_value_get_string(value));
143         break;
144     case PROP_DATA:
145         webkit_dom_html_object_element_set_data(self, g_value_get_string(value));
146         break;
147     case PROP_DECLARE:
148         webkit_dom_html_object_element_set_declare(self, g_value_get_boolean(value));
149         break;
150     case PROP_HEIGHT:
151         webkit_dom_html_object_element_set_height(self, g_value_get_string(value));
152         break;
153     case PROP_HSPACE:
154         webkit_dom_html_object_element_set_hspace(self, g_value_get_long(value));
155         break;
156     case PROP_NAME:
157         webkit_dom_html_object_element_set_name(self, g_value_get_string(value));
158         break;
159     case PROP_STANDBY:
160         webkit_dom_html_object_element_set_standby(self, g_value_get_string(value));
161         break;
162     case PROP_TYPE:
163         webkit_dom_html_object_element_set_type_attr(self, g_value_get_string(value));
164         break;
165     case PROP_USE_MAP:
166         webkit_dom_html_object_element_set_use_map(self, g_value_get_string(value));
167         break;
168     case PROP_VSPACE:
169         webkit_dom_html_object_element_set_vspace(self, g_value_get_long(value));
170         break;
171     case PROP_WIDTH:
172         webkit_dom_html_object_element_set_width(self, g_value_get_string(value));
173         break;
174     default:
175         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
176         break;
177     }
178 }
179
180 static void webkit_dom_html_object_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
181 {
182     WebKitDOMHTMLObjectElement* self = WEBKIT_DOM_HTML_OBJECT_ELEMENT(object);
183
184     switch (propertyId) {
185     case PROP_FORM:
186         g_value_set_object(value, webkit_dom_html_object_element_get_form(self));
187         break;
188     case PROP_CODE:
189         g_value_take_string(value, webkit_dom_html_object_element_get_code(self));
190         break;
191     case PROP_ALIGN:
192         g_value_take_string(value, webkit_dom_html_object_element_get_align(self));
193         break;
194     case PROP_ARCHIVE:
195         g_value_take_string(value, webkit_dom_html_object_element_get_archive(self));
196         break;
197     case PROP_BORDER:
198         g_value_take_string(value, webkit_dom_html_object_element_get_border(self));
199         break;
200     case PROP_CODE_BASE:
201         g_value_take_string(value, webkit_dom_html_object_element_get_code_base(self));
202         break;
203     case PROP_CODE_TYPE:
204         g_value_take_string(value, webkit_dom_html_object_element_get_code_type(self));
205         break;
206     case PROP_DATA:
207         g_value_take_string(value, webkit_dom_html_object_element_get_data(self));
208         break;
209     case PROP_DECLARE:
210         g_value_set_boolean(value, webkit_dom_html_object_element_get_declare(self));
211         break;
212     case PROP_HEIGHT:
213         g_value_take_string(value, webkit_dom_html_object_element_get_height(self));
214         break;
215     case PROP_HSPACE:
216         g_value_set_long(value, webkit_dom_html_object_element_get_hspace(self));
217         break;
218     case PROP_NAME:
219         g_value_take_string(value, webkit_dom_html_object_element_get_name(self));
220         break;
221     case PROP_STANDBY:
222         g_value_take_string(value, webkit_dom_html_object_element_get_standby(self));
223         break;
224     case PROP_TYPE:
225         g_value_take_string(value, webkit_dom_html_object_element_get_type_attr(self));
226         break;
227     case PROP_USE_MAP:
228         g_value_take_string(value, webkit_dom_html_object_element_get_use_map(self));
229         break;
230     case PROP_VSPACE:
231         g_value_set_long(value, webkit_dom_html_object_element_get_vspace(self));
232         break;
233     case PROP_WIDTH:
234         g_value_take_string(value, webkit_dom_html_object_element_get_width(self));
235         break;
236     case PROP_CONTENT_DOCUMENT:
237         g_value_set_object(value, webkit_dom_html_object_element_get_content_document(self));
238         break;
239     default:
240         G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
241         break;
242     }
243 }
244
245 static void webkit_dom_html_object_element_class_init(WebKitDOMHTMLObjectElementClass* requestClass)
246 {
247     GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);
248     gobjectClass->set_property = webkit_dom_html_object_element_set_property;
249     gobjectClass->get_property = webkit_dom_html_object_element_get_property;
250
251     g_object_class_install_property(
252         gobjectClass,
253         PROP_FORM,
254         g_param_spec_object(
255             "form",
256             "HTMLObjectElement:form",
257             "read-only WebKitDOMHTMLFormElement* HTMLObjectElement:form",
258             WEBKIT_DOM_TYPE_HTML_FORM_ELEMENT,
259             WEBKIT_PARAM_READABLE));
260
261     g_object_class_install_property(
262         gobjectClass,
263         PROP_CODE,
264         g_param_spec_string(
265             "code",
266             "HTMLObjectElement:code",
267             "read-write gchar* HTMLObjectElement:code",
268             "",
269             WEBKIT_PARAM_READWRITE));
270
271     g_object_class_install_property(
272         gobjectClass,
273         PROP_ALIGN,
274         g_param_spec_string(
275             "align",
276             "HTMLObjectElement:align",
277             "read-write gchar* HTMLObjectElement:align",
278             "",
279             WEBKIT_PARAM_READWRITE));
280
281     g_object_class_install_property(
282         gobjectClass,
283         PROP_ARCHIVE,
284         g_param_spec_string(
285             "archive",
286             "HTMLObjectElement:archive",
287             "read-write gchar* HTMLObjectElement:archive",
288             "",
289             WEBKIT_PARAM_READWRITE));
290
291     g_object_class_install_property(
292         gobjectClass,
293         PROP_BORDER,
294         g_param_spec_string(
295             "border",
296             "HTMLObjectElement:border",
297             "read-write gchar* HTMLObjectElement:border",
298             "",
299             WEBKIT_PARAM_READWRITE));
300
301     g_object_class_install_property(
302         gobjectClass,
303         PROP_CODE_BASE,
304         g_param_spec_string(
305             "code-base",
306             "HTMLObjectElement:code-base",
307             "read-write gchar* HTMLObjectElement:code-base",
308             "",
309             WEBKIT_PARAM_READWRITE));
310
311     g_object_class_install_property(
312         gobjectClass,
313         PROP_CODE_TYPE,
314         g_param_spec_string(
315             "code-type",
316             "HTMLObjectElement:code-type",
317             "read-write gchar* HTMLObjectElement:code-type",
318             "",
319             WEBKIT_PARAM_READWRITE));
320
321     g_object_class_install_property(
322         gobjectClass,
323         PROP_DATA,
324         g_param_spec_string(
325             "data",
326             "HTMLObjectElement:data",
327             "read-write gchar* HTMLObjectElement:data",
328             "",
329             WEBKIT_PARAM_READWRITE));
330
331     g_object_class_install_property(
332         gobjectClass,
333         PROP_DECLARE,
334         g_param_spec_boolean(
335             "declare",
336             "HTMLObjectElement:declare",
337             "read-write gboolean HTMLObjectElement:declare",
338             FALSE,
339             WEBKIT_PARAM_READWRITE));
340
341     g_object_class_install_property(
342         gobjectClass,
343         PROP_HEIGHT,
344         g_param_spec_string(
345             "height",
346             "HTMLObjectElement:height",
347             "read-write gchar* HTMLObjectElement:height",
348             "",
349             WEBKIT_PARAM_READWRITE));
350
351     g_object_class_install_property(
352         gobjectClass,
353         PROP_HSPACE,
354         g_param_spec_long(
355             "hspace",
356             "HTMLObjectElement:hspace",
357             "read-write glong HTMLObjectElement:hspace",
358             G_MINLONG, G_MAXLONG, 0,
359             WEBKIT_PARAM_READWRITE));
360
361     g_object_class_install_property(
362         gobjectClass,
363         PROP_NAME,
364         g_param_spec_string(
365             "name",
366             "HTMLObjectElement:name",
367             "read-write gchar* HTMLObjectElement:name",
368             "",
369             WEBKIT_PARAM_READWRITE));
370
371     g_object_class_install_property(
372         gobjectClass,
373         PROP_STANDBY,
374         g_param_spec_string(
375             "standby",
376             "HTMLObjectElement:standby",
377             "read-write gchar* HTMLObjectElement:standby",
378             "",
379             WEBKIT_PARAM_READWRITE));
380
381     g_object_class_install_property(
382         gobjectClass,
383         PROP_TYPE,
384         g_param_spec_string(
385             "type",
386             "HTMLObjectElement:type",
387             "read-write gchar* HTMLObjectElement:type",
388             "",
389             WEBKIT_PARAM_READWRITE));
390
391     g_object_class_install_property(
392         gobjectClass,
393         PROP_USE_MAP,
394         g_param_spec_string(
395             "use-map",
396             "HTMLObjectElement:use-map",
397             "read-write gchar* HTMLObjectElement:use-map",
398             "",
399             WEBKIT_PARAM_READWRITE));
400
401     g_object_class_install_property(
402         gobjectClass,
403         PROP_VSPACE,
404         g_param_spec_long(
405             "vspace",
406             "HTMLObjectElement:vspace",
407             "read-write glong HTMLObjectElement:vspace",
408             G_MINLONG, G_MAXLONG, 0,
409             WEBKIT_PARAM_READWRITE));
410
411     g_object_class_install_property(
412         gobjectClass,
413         PROP_WIDTH,
414         g_param_spec_string(
415             "width",
416             "HTMLObjectElement:width",
417             "read-write gchar* HTMLObjectElement:width",
418             "",
419             WEBKIT_PARAM_READWRITE));
420
421     g_object_class_install_property(
422         gobjectClass,
423         PROP_CONTENT_DOCUMENT,
424         g_param_spec_object(
425             "content-document",
426             "HTMLObjectElement:content-document",
427             "read-only WebKitDOMDocument* HTMLObjectElement:content-document",
428             WEBKIT_DOM_TYPE_DOCUMENT,
429             WEBKIT_PARAM_READABLE));
430
431 }
432
433 static void webkit_dom_html_object_element_init(WebKitDOMHTMLObjectElement* request)
434 {
435     UNUSED_PARAM(request);
436 }
437
438 WebKitDOMHTMLFormElement* webkit_dom_html_object_element_get_form(WebKitDOMHTMLObjectElement* self)
439 {
440     WebCore::JSMainThreadNullState state;
441     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
442     WebCore::HTMLObjectElement* item = WebKit::core(self);
443     RefPtr<WebCore::HTMLFormElement> gobjectResult = WTF::getPtr(item->form());
444     return WebKit::kit(gobjectResult.get());
445 }
446
447 gchar* webkit_dom_html_object_element_get_code(WebKitDOMHTMLObjectElement* self)
448 {
449     WebCore::JSMainThreadNullState state;
450     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
451     WebCore::HTMLObjectElement* item = WebKit::core(self);
452     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::codeAttr));
453     return result;
454 }
455
456 void webkit_dom_html_object_element_set_code(WebKitDOMHTMLObjectElement* self, const gchar* value)
457 {
458     WebCore::JSMainThreadNullState state;
459     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
460     g_return_if_fail(value);
461     WebCore::HTMLObjectElement* item = WebKit::core(self);
462     WTF::String convertedValue = WTF::String::fromUTF8(value);
463     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::codeAttr, convertedValue);
464 }
465
466 gchar* webkit_dom_html_object_element_get_align(WebKitDOMHTMLObjectElement* self)
467 {
468     WebCore::JSMainThreadNullState state;
469     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
470     WebCore::HTMLObjectElement* item = WebKit::core(self);
471     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr));
472     return result;
473 }
474
475 void webkit_dom_html_object_element_set_align(WebKitDOMHTMLObjectElement* self, const gchar* value)
476 {
477     WebCore::JSMainThreadNullState state;
478     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
479     g_return_if_fail(value);
480     WebCore::HTMLObjectElement* item = WebKit::core(self);
481     WTF::String convertedValue = WTF::String::fromUTF8(value);
482     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, convertedValue);
483 }
484
485 gchar* webkit_dom_html_object_element_get_archive(WebKitDOMHTMLObjectElement* self)
486 {
487     WebCore::JSMainThreadNullState state;
488     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
489     WebCore::HTMLObjectElement* item = WebKit::core(self);
490     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::archiveAttr));
491     return result;
492 }
493
494 void webkit_dom_html_object_element_set_archive(WebKitDOMHTMLObjectElement* self, const gchar* value)
495 {
496     WebCore::JSMainThreadNullState state;
497     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
498     g_return_if_fail(value);
499     WebCore::HTMLObjectElement* item = WebKit::core(self);
500     WTF::String convertedValue = WTF::String::fromUTF8(value);
501     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::archiveAttr, convertedValue);
502 }
503
504 gchar* webkit_dom_html_object_element_get_border(WebKitDOMHTMLObjectElement* self)
505 {
506     WebCore::JSMainThreadNullState state;
507     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
508     WebCore::HTMLObjectElement* item = WebKit::core(self);
509     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::borderAttr));
510     return result;
511 }
512
513 void webkit_dom_html_object_element_set_border(WebKitDOMHTMLObjectElement* self, const gchar* value)
514 {
515     WebCore::JSMainThreadNullState state;
516     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
517     g_return_if_fail(value);
518     WebCore::HTMLObjectElement* item = WebKit::core(self);
519     WTF::String convertedValue = WTF::String::fromUTF8(value);
520     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::borderAttr, convertedValue);
521 }
522
523 gchar* webkit_dom_html_object_element_get_code_base(WebKitDOMHTMLObjectElement* self)
524 {
525     WebCore::JSMainThreadNullState state;
526     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
527     WebCore::HTMLObjectElement* item = WebKit::core(self);
528     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::codebaseAttr));
529     return result;
530 }
531
532 void webkit_dom_html_object_element_set_code_base(WebKitDOMHTMLObjectElement* self, const gchar* value)
533 {
534     WebCore::JSMainThreadNullState state;
535     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
536     g_return_if_fail(value);
537     WebCore::HTMLObjectElement* item = WebKit::core(self);
538     WTF::String convertedValue = WTF::String::fromUTF8(value);
539     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::codebaseAttr, convertedValue);
540 }
541
542 gchar* webkit_dom_html_object_element_get_code_type(WebKitDOMHTMLObjectElement* self)
543 {
544     WebCore::JSMainThreadNullState state;
545     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
546     WebCore::HTMLObjectElement* item = WebKit::core(self);
547     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::codetypeAttr));
548     return result;
549 }
550
551 void webkit_dom_html_object_element_set_code_type(WebKitDOMHTMLObjectElement* self, const gchar* value)
552 {
553     WebCore::JSMainThreadNullState state;
554     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
555     g_return_if_fail(value);
556     WebCore::HTMLObjectElement* item = WebKit::core(self);
557     WTF::String convertedValue = WTF::String::fromUTF8(value);
558     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::codetypeAttr, convertedValue);
559 }
560
561 gchar* webkit_dom_html_object_element_get_data(WebKitDOMHTMLObjectElement* self)
562 {
563     WebCore::JSMainThreadNullState state;
564     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
565     WebCore::HTMLObjectElement* item = WebKit::core(self);
566     gchar* result = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::dataAttr));
567     return result;
568 }
569
570 void webkit_dom_html_object_element_set_data(WebKitDOMHTMLObjectElement* self, const gchar* value)
571 {
572     WebCore::JSMainThreadNullState state;
573     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
574     g_return_if_fail(value);
575     WebCore::HTMLObjectElement* item = WebKit::core(self);
576     WTF::String convertedValue = WTF::String::fromUTF8(value);
577     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::dataAttr, convertedValue);
578 }
579
580 gboolean webkit_dom_html_object_element_get_declare(WebKitDOMHTMLObjectElement* self)
581 {
582     WebCore::JSMainThreadNullState state;
583     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), FALSE);
584     WebCore::HTMLObjectElement* item = WebKit::core(self);
585     gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::declareAttr);
586     return result;
587 }
588
589 void webkit_dom_html_object_element_set_declare(WebKitDOMHTMLObjectElement* self, gboolean value)
590 {
591     WebCore::JSMainThreadNullState state;
592     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
593     WebCore::HTMLObjectElement* item = WebKit::core(self);
594     item->setBooleanAttribute(WebCore::HTMLNames::declareAttr, value);
595 }
596
597 gchar* webkit_dom_html_object_element_get_height(WebKitDOMHTMLObjectElement* self)
598 {
599     WebCore::JSMainThreadNullState state;
600     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
601     WebCore::HTMLObjectElement* item = WebKit::core(self);
602     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::heightAttr));
603     return result;
604 }
605
606 void webkit_dom_html_object_element_set_height(WebKitDOMHTMLObjectElement* self, const gchar* value)
607 {
608     WebCore::JSMainThreadNullState state;
609     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
610     g_return_if_fail(value);
611     WebCore::HTMLObjectElement* item = WebKit::core(self);
612     WTF::String convertedValue = WTF::String::fromUTF8(value);
613     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, convertedValue);
614 }
615
616 glong webkit_dom_html_object_element_get_hspace(WebKitDOMHTMLObjectElement* self)
617 {
618     WebCore::JSMainThreadNullState state;
619     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
620     WebCore::HTMLObjectElement* item = WebKit::core(self);
621     glong result = item->getIntegralAttribute(WebCore::HTMLNames::hspaceAttr);
622     return result;
623 }
624
625 void webkit_dom_html_object_element_set_hspace(WebKitDOMHTMLObjectElement* self, glong value)
626 {
627     WebCore::JSMainThreadNullState state;
628     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
629     WebCore::HTMLObjectElement* item = WebKit::core(self);
630     item->setIntegralAttribute(WebCore::HTMLNames::hspaceAttr, value);
631 }
632
633 gchar* webkit_dom_html_object_element_get_name(WebKitDOMHTMLObjectElement* self)
634 {
635     WebCore::JSMainThreadNullState state;
636     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
637     WebCore::HTMLObjectElement* item = WebKit::core(self);
638     gchar* result = convertToUTF8String(item->getNameAttribute());
639     return result;
640 }
641
642 void webkit_dom_html_object_element_set_name(WebKitDOMHTMLObjectElement* self, const gchar* value)
643 {
644     WebCore::JSMainThreadNullState state;
645     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
646     g_return_if_fail(value);
647     WebCore::HTMLObjectElement* item = WebKit::core(self);
648     WTF::String convertedValue = WTF::String::fromUTF8(value);
649     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, convertedValue);
650 }
651
652 gchar* webkit_dom_html_object_element_get_standby(WebKitDOMHTMLObjectElement* self)
653 {
654     WebCore::JSMainThreadNullState state;
655     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
656     WebCore::HTMLObjectElement* item = WebKit::core(self);
657     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::standbyAttr));
658     return result;
659 }
660
661 void webkit_dom_html_object_element_set_standby(WebKitDOMHTMLObjectElement* self, const gchar* value)
662 {
663     WebCore::JSMainThreadNullState state;
664     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
665     g_return_if_fail(value);
666     WebCore::HTMLObjectElement* item = WebKit::core(self);
667     WTF::String convertedValue = WTF::String::fromUTF8(value);
668     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::standbyAttr, convertedValue);
669 }
670
671 gchar* webkit_dom_html_object_element_get_type_attr(WebKitDOMHTMLObjectElement* self)
672 {
673     WebCore::JSMainThreadNullState state;
674     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
675     WebCore::HTMLObjectElement* item = WebKit::core(self);
676     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::typeAttr));
677     return result;
678 }
679
680 void webkit_dom_html_object_element_set_type_attr(WebKitDOMHTMLObjectElement* self, const gchar* value)
681 {
682     WebCore::JSMainThreadNullState state;
683     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
684     g_return_if_fail(value);
685     WebCore::HTMLObjectElement* item = WebKit::core(self);
686     WTF::String convertedValue = WTF::String::fromUTF8(value);
687     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::typeAttr, convertedValue);
688 }
689
690 gchar* webkit_dom_html_object_element_get_use_map(WebKitDOMHTMLObjectElement* self)
691 {
692     WebCore::JSMainThreadNullState state;
693     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
694     WebCore::HTMLObjectElement* item = WebKit::core(self);
695     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr));
696     return result;
697 }
698
699 void webkit_dom_html_object_element_set_use_map(WebKitDOMHTMLObjectElement* self, const gchar* value)
700 {
701     WebCore::JSMainThreadNullState state;
702     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
703     g_return_if_fail(value);
704     WebCore::HTMLObjectElement* item = WebKit::core(self);
705     WTF::String convertedValue = WTF::String::fromUTF8(value);
706     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::usemapAttr, convertedValue);
707 }
708
709 glong webkit_dom_html_object_element_get_vspace(WebKitDOMHTMLObjectElement* self)
710 {
711     WebCore::JSMainThreadNullState state;
712     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
713     WebCore::HTMLObjectElement* item = WebKit::core(self);
714     glong result = item->getIntegralAttribute(WebCore::HTMLNames::vspaceAttr);
715     return result;
716 }
717
718 void webkit_dom_html_object_element_set_vspace(WebKitDOMHTMLObjectElement* self, glong value)
719 {
720     WebCore::JSMainThreadNullState state;
721     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
722     WebCore::HTMLObjectElement* item = WebKit::core(self);
723     item->setIntegralAttribute(WebCore::HTMLNames::vspaceAttr, value);
724 }
725
726 gchar* webkit_dom_html_object_element_get_width(WebKitDOMHTMLObjectElement* self)
727 {
728     WebCore::JSMainThreadNullState state;
729     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
730     WebCore::HTMLObjectElement* item = WebKit::core(self);
731     gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::widthAttr));
732     return result;
733 }
734
735 void webkit_dom_html_object_element_set_width(WebKitDOMHTMLObjectElement* self, const gchar* value)
736 {
737     WebCore::JSMainThreadNullState state;
738     g_return_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self));
739     g_return_if_fail(value);
740     WebCore::HTMLObjectElement* item = WebKit::core(self);
741     WTF::String convertedValue = WTF::String::fromUTF8(value);
742     item->setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, convertedValue);
743 }
744
745 WebKitDOMDocument* webkit_dom_html_object_element_get_content_document(WebKitDOMHTMLObjectElement* self)
746 {
747     WebCore::JSMainThreadNullState state;
748     g_return_val_if_fail(WEBKIT_DOM_IS_HTML_OBJECT_ELEMENT(self), 0);
749     WebCore::HTMLObjectElement* item = WebKit::core(self);
750     RefPtr<WebCore::Document> gobjectResult = WTF::getPtr(item->contentDocument());
751     return WebKit::kit(gobjectResult.get());
752 }
753