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