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 "WebKitDOMHTMLIFrameElement.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 "WebKitDOMDOMWindowPrivate.h"
31#include "WebKitDOMDocumentPrivate.h"
32#include "WebKitDOMEventPrivate.h"
33#include "WebKitDOMEventTarget.h"
34#include "WebKitDOMHTMLIFrameElementPrivate.h"
35#include "WebKitDOMNodePrivate.h"
36#include "WebKitDOMPrivate.h"
37#include "ConvertToUTF8String.h"
38#include <wtf/GetPtr.h>
39#include <wtf/RefPtr.h>
40
41G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
42
43namespace WebKit {
44
45WebKitDOMHTMLIFrameElement* kit(WebCore::HTMLIFrameElement* obj)
46{
47 return WEBKIT_DOM_HTML_IFRAME_ELEMENT(kit(static_cast<WebCore::Node*>(obj)));
48}
49
50WebCore::HTMLIFrameElement* core(WebKitDOMHTMLIFrameElement* request)
51{
52 return request ? static_cast<WebCore::HTMLIFrameElement*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0;
53}
54
55WebKitDOMHTMLIFrameElement* wrapHTMLIFrameElement(WebCore::HTMLIFrameElement* coreObject)
56{
57 ASSERT(coreObject);
58 return WEBKIT_DOM_HTML_IFRAME_ELEMENT(g_object_new(WEBKIT_DOM_TYPE_HTML_IFRAME_ELEMENT, "core-object", coreObject, nullptr));
59}
60
61} // namespace WebKit
62
63static gboolean webkit_dom_html_iframe_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::HTMLIFrameElement* coreTarget = static_cast<WebCore::HTMLIFrameElement*>(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
79static gboolean webkit_dom_html_iframe_element_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture)
80{
81 WebCore::HTMLIFrameElement* coreTarget = static_cast<WebCore::HTMLIFrameElement*>(WEBKIT_DOM_OBJECT(target)->coreObject);
82 return WebKit::GObjectEventListener::addEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture);
83}
84
85static gboolean webkit_dom_html_iframe_element_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture)
86{
87 WebCore::HTMLIFrameElement* coreTarget = static_cast<WebCore::HTMLIFrameElement*>(WEBKIT_DOM_OBJECT(target)->coreObject);
88 return WebKit::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture);
89}
90
91static void webkit_dom_html_iframe_element_dom_event_target_init(WebKitDOMEventTargetIface* iface)
92{
93 iface->dispatch_event = webkit_dom_html_iframe_element_dispatch_event;
94 iface->add_event_listener = webkit_dom_html_iframe_element_add_event_listener;
95 iface->remove_event_listener = webkit_dom_html_iframe_element_remove_event_listener;
96}
97
98G_DEFINE_TYPE_WITH_CODE(WebKitDOMHTMLIFrameElement, webkit_dom_html_iframe_element, WEBKIT_DOM_TYPE_HTML_ELEMENT, G_IMPLEMENT_INTERFACE(WEBKIT_DOM_TYPE_EVENT_TARGET, webkit_dom_html_iframe_element_dom_event_target_init))
99
100enum {
101 DOM_HTML_IFRAME_ELEMENT_PROP_0,
102 DOM_HTML_IFRAME_ELEMENT_PROP_ALIGN,
103 DOM_HTML_IFRAME_ELEMENT_PROP_FRAME_BORDER,
104 DOM_HTML_IFRAME_ELEMENT_PROP_HEIGHT,
105 DOM_HTML_IFRAME_ELEMENT_PROP_LONG_DESC,
106 DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_HEIGHT,
107 DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_WIDTH,
108 DOM_HTML_IFRAME_ELEMENT_PROP_NAME,
109 DOM_HTML_IFRAME_ELEMENT_PROP_SCROLLING,
110 DOM_HTML_IFRAME_ELEMENT_PROP_SRC,
111 DOM_HTML_IFRAME_ELEMENT_PROP_WIDTH,
112 DOM_HTML_IFRAME_ELEMENT_PROP_CONTENT_DOCUMENT,
113 DOM_HTML_IFRAME_ELEMENT_PROP_CONTENT_WINDOW,
114};
115
116static void webkit_dom_html_iframe_element_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
117{
118 WebKitDOMHTMLIFrameElement* self = WEBKIT_DOM_HTML_IFRAME_ELEMENT(object);
119
120 switch (propertyId) {
121 case DOM_HTML_IFRAME_ELEMENT_PROP_ALIGN:
122 webkit_dom_html_iframe_element_set_align(self, g_value_get_string(value));
123 break;
124 case DOM_HTML_IFRAME_ELEMENT_PROP_FRAME_BORDER:
125 webkit_dom_html_iframe_element_set_frame_border(self, g_value_get_string(value));
126 break;
127 case DOM_HTML_IFRAME_ELEMENT_PROP_HEIGHT:
128 webkit_dom_html_iframe_element_set_height(self, g_value_get_string(value));
129 break;
130 case DOM_HTML_IFRAME_ELEMENT_PROP_LONG_DESC:
131 webkit_dom_html_iframe_element_set_long_desc(self, g_value_get_string(value));
132 break;
133 case DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_HEIGHT:
134 webkit_dom_html_iframe_element_set_margin_height(self, g_value_get_string(value));
135 break;
136 case DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_WIDTH:
137 webkit_dom_html_iframe_element_set_margin_width(self, g_value_get_string(value));
138 break;
139 case DOM_HTML_IFRAME_ELEMENT_PROP_NAME:
140 webkit_dom_html_iframe_element_set_name(self, g_value_get_string(value));
141 break;
142 case DOM_HTML_IFRAME_ELEMENT_PROP_SCROLLING:
143 webkit_dom_html_iframe_element_set_scrolling(self, g_value_get_string(value));
144 break;
145 case DOM_HTML_IFRAME_ELEMENT_PROP_SRC:
146 webkit_dom_html_iframe_element_set_src(self, g_value_get_string(value));
147 break;
148 case DOM_HTML_IFRAME_ELEMENT_PROP_WIDTH:
149 webkit_dom_html_iframe_element_set_width(self, g_value_get_string(value));
150 break;
151 default:
152 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
153 break;
154 }
155}
156
157static void webkit_dom_html_iframe_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
158{
159 WebKitDOMHTMLIFrameElement* self = WEBKIT_DOM_HTML_IFRAME_ELEMENT(object);
160
161 switch (propertyId) {
162 case DOM_HTML_IFRAME_ELEMENT_PROP_ALIGN:
163 g_value_take_string(value, webkit_dom_html_iframe_element_get_align(self));
164 break;
165 case DOM_HTML_IFRAME_ELEMENT_PROP_FRAME_BORDER:
166 g_value_take_string(value, webkit_dom_html_iframe_element_get_frame_border(self));
167 break;
168 case DOM_HTML_IFRAME_ELEMENT_PROP_HEIGHT:
169 g_value_take_string(value, webkit_dom_html_iframe_element_get_height(self));
170 break;
171 case DOM_HTML_IFRAME_ELEMENT_PROP_LONG_DESC:
172 g_value_take_string(value, webkit_dom_html_iframe_element_get_long_desc(self));
173 break;
174 case DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_HEIGHT:
175 g_value_take_string(value, webkit_dom_html_iframe_element_get_margin_height(self));
176 break;
177 case DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_WIDTH:
178 g_value_take_string(value, webkit_dom_html_iframe_element_get_margin_width(self));
179 break;
180 case DOM_HTML_IFRAME_ELEMENT_PROP_NAME:
181 g_value_take_string(value, webkit_dom_html_iframe_element_get_name(self));
182 break;
183 case DOM_HTML_IFRAME_ELEMENT_PROP_SCROLLING:
184 g_value_take_string(value, webkit_dom_html_iframe_element_get_scrolling(self));
185 break;
186 case DOM_HTML_IFRAME_ELEMENT_PROP_SRC:
187 g_value_take_string(value, webkit_dom_html_iframe_element_get_src(self));
188 break;
189 case DOM_HTML_IFRAME_ELEMENT_PROP_WIDTH:
190 g_value_take_string(value, webkit_dom_html_iframe_element_get_width(self));
191 break;
192 case DOM_HTML_IFRAME_ELEMENT_PROP_CONTENT_DOCUMENT:
193 g_value_set_object(value, webkit_dom_html_iframe_element_get_content_document(self));
194 break;
195 case DOM_HTML_IFRAME_ELEMENT_PROP_CONTENT_WINDOW:
196 g_value_set_object(value, webkit_dom_html_iframe_element_get_content_window(self));
197 break;
198 default:
199 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec);
200 break;
201 }
202}
203
204static void webkit_dom_html_iframe_element_class_init(WebKitDOMHTMLIFrameElementClass* requestClass)
205{
206 GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass);
207 gobjectClass->set_property = webkit_dom_html_iframe_element_set_property;
208 gobjectClass->get_property = webkit_dom_html_iframe_element_get_property;
209
210 g_object_class_install_property(
211 gobjectClass,
212 DOM_HTML_IFRAME_ELEMENT_PROP_ALIGN,
213 g_param_spec_string(
214 "align",
215 "HTMLIFrameElement:align",
216 "read-write gchar* HTMLIFrameElement:align",
217 "",
218 WEBKIT_PARAM_READWRITE));
219
220 g_object_class_install_property(
221 gobjectClass,
222 DOM_HTML_IFRAME_ELEMENT_PROP_FRAME_BORDER,
223 g_param_spec_string(
224 "frame-border",
225 "HTMLIFrameElement:frame-border",
226 "read-write gchar* HTMLIFrameElement:frame-border",
227 "",
228 WEBKIT_PARAM_READWRITE));
229
230 g_object_class_install_property(
231 gobjectClass,
232 DOM_HTML_IFRAME_ELEMENT_PROP_HEIGHT,
233 g_param_spec_string(
234 "height",
235 "HTMLIFrameElement:height",
236 "read-write gchar* HTMLIFrameElement:height",
237 "",
238 WEBKIT_PARAM_READWRITE));
239
240 g_object_class_install_property(
241 gobjectClass,
242 DOM_HTML_IFRAME_ELEMENT_PROP_LONG_DESC,
243 g_param_spec_string(
244 "long-desc",
245 "HTMLIFrameElement:long-desc",
246 "read-write gchar* HTMLIFrameElement:long-desc",
247 "",
248 WEBKIT_PARAM_READWRITE));
249
250 g_object_class_install_property(
251 gobjectClass,
252 DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_HEIGHT,
253 g_param_spec_string(
254 "margin-height",
255 "HTMLIFrameElement:margin-height",
256 "read-write gchar* HTMLIFrameElement:margin-height",
257 "",
258 WEBKIT_PARAM_READWRITE));
259
260 g_object_class_install_property(
261 gobjectClass,
262 DOM_HTML_IFRAME_ELEMENT_PROP_MARGIN_WIDTH,
263 g_param_spec_string(
264 "margin-width",
265 "HTMLIFrameElement:margin-width",
266 "read-write gchar* HTMLIFrameElement:margin-width",
267 "",
268 WEBKIT_PARAM_READWRITE));
269
270 g_object_class_install_property(
271 gobjectClass,
272 DOM_HTML_IFRAME_ELEMENT_PROP_NAME,
273 g_param_spec_string(
274 "name",
275 "HTMLIFrameElement:name",
276 "read-write gchar* HTMLIFrameElement:name",
277 "",
278 WEBKIT_PARAM_READWRITE));
279
280 g_object_class_install_property(
281 gobjectClass,
282 DOM_HTML_IFRAME_ELEMENT_PROP_SCROLLING,
283 g_param_spec_string(
284 "scrolling",
285 "HTMLIFrameElement:scrolling",
286 "read-write gchar* HTMLIFrameElement:scrolling",
287 "",
288 WEBKIT_PARAM_READWRITE));
289
290 g_object_class_install_property(
291 gobjectClass,
292 DOM_HTML_IFRAME_ELEMENT_PROP_SRC,
293 g_param_spec_string(
294 "src",
295 "HTMLIFrameElement:src",
296 "read-write gchar* HTMLIFrameElement:src",
297 "",
298 WEBKIT_PARAM_READWRITE));
299
300 g_object_class_install_property(
301 gobjectClass,
302 DOM_HTML_IFRAME_ELEMENT_PROP_WIDTH,
303 g_param_spec_string(
304 "width",
305 "HTMLIFrameElement:width",
306 "read-write gchar* HTMLIFrameElement:width",
307 "",
308 WEBKIT_PARAM_READWRITE));
309
310 g_object_class_install_property(
311 gobjectClass,
312 DOM_HTML_IFRAME_ELEMENT_PROP_CONTENT_DOCUMENT,
313 g_param_spec_object(
314 "content-document",
315 "HTMLIFrameElement:content-document",
316 "read-only WebKitDOMDocument* HTMLIFrameElement:content-document",
317 WEBKIT_DOM_TYPE_DOCUMENT,
318 WEBKIT_PARAM_READABLE));
319
320 g_object_class_install_property(
321 gobjectClass,
322 DOM_HTML_IFRAME_ELEMENT_PROP_CONTENT_WINDOW,
323 g_param_spec_object(
324 "content-window",
325 "HTMLIFrameElement:content-window",
326 "read-only WebKitDOMDOMWindow* HTMLIFrameElement:content-window",
327 WEBKIT_DOM_TYPE_DOM_WINDOW,
328 WEBKIT_PARAM_READABLE));
329
330}
331
332static void webkit_dom_html_iframe_element_init(WebKitDOMHTMLIFrameElement* request)
333{
334 UNUSED_PARAM(request);
335}
336
337gchar* webkit_dom_html_iframe_element_get_align(WebKitDOMHTMLIFrameElement* self)
338{
339 WebCore::JSMainThreadNullState state;
340 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
341 WebCore::HTMLIFrameElement* item = WebKit::core(self);
342 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr));
343 return result;
344}
345
346void webkit_dom_html_iframe_element_set_align(WebKitDOMHTMLIFrameElement* self, const gchar* value)
347{
348 WebCore::JSMainThreadNullState state;
349 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
350 g_return_if_fail(value);
351 WebCore::HTMLIFrameElement* item = WebKit::core(self);
352 WTF::String convertedValue = WTF::String::fromUTF8(value);
353 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, convertedValue);
354}
355
356gchar* webkit_dom_html_iframe_element_get_frame_border(WebKitDOMHTMLIFrameElement* self)
357{
358 WebCore::JSMainThreadNullState state;
359 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
360 WebCore::HTMLIFrameElement* item = WebKit::core(self);
361 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr));
362 return result;
363}
364
365void webkit_dom_html_iframe_element_set_frame_border(WebKitDOMHTMLIFrameElement* self, const gchar* value)
366{
367 WebCore::JSMainThreadNullState state;
368 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
369 g_return_if_fail(value);
370 WebCore::HTMLIFrameElement* item = WebKit::core(self);
371 WTF::String convertedValue = WTF::String::fromUTF8(value);
372 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr, convertedValue);
373}
374
375gchar* webkit_dom_html_iframe_element_get_height(WebKitDOMHTMLIFrameElement* self)
376{
377 WebCore::JSMainThreadNullState state;
378 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
379 WebCore::HTMLIFrameElement* item = WebKit::core(self);
380 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::heightAttr));
381 return result;
382}
383
384void webkit_dom_html_iframe_element_set_height(WebKitDOMHTMLIFrameElement* self, const gchar* value)
385{
386 WebCore::JSMainThreadNullState state;
387 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
388 g_return_if_fail(value);
389 WebCore::HTMLIFrameElement* item = WebKit::core(self);
390 WTF::String convertedValue = WTF::String::fromUTF8(value);
391 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, convertedValue);
392}
393
394gchar* webkit_dom_html_iframe_element_get_long_desc(WebKitDOMHTMLIFrameElement* self)
395{
396 WebCore::JSMainThreadNullState state;
397 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
398 WebCore::HTMLIFrameElement* item = WebKit::core(self);
399 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::longdescAttr));
400 return result;
401}
402
403void webkit_dom_html_iframe_element_set_long_desc(WebKitDOMHTMLIFrameElement* self, const gchar* value)
404{
405 WebCore::JSMainThreadNullState state;
406 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
407 g_return_if_fail(value);
408 WebCore::HTMLIFrameElement* item = WebKit::core(self);
409 WTF::String convertedValue = WTF::String::fromUTF8(value);
410 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::longdescAttr, convertedValue);
411}
412
413gchar* webkit_dom_html_iframe_element_get_margin_height(WebKitDOMHTMLIFrameElement* self)
414{
415 WebCore::JSMainThreadNullState state;
416 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
417 WebCore::HTMLIFrameElement* item = WebKit::core(self);
418 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr));
419 return result;
420}
421
422void webkit_dom_html_iframe_element_set_margin_height(WebKitDOMHTMLIFrameElement* self, const gchar* value)
423{
424 WebCore::JSMainThreadNullState state;
425 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
426 g_return_if_fail(value);
427 WebCore::HTMLIFrameElement* item = WebKit::core(self);
428 WTF::String convertedValue = WTF::String::fromUTF8(value);
429 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr, convertedValue);
430}
431
432gchar* webkit_dom_html_iframe_element_get_margin_width(WebKitDOMHTMLIFrameElement* self)
433{
434 WebCore::JSMainThreadNullState state;
435 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
436 WebCore::HTMLIFrameElement* item = WebKit::core(self);
437 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr));
438 return result;
439}
440
441void webkit_dom_html_iframe_element_set_margin_width(WebKitDOMHTMLIFrameElement* self, const gchar* value)
442{
443 WebCore::JSMainThreadNullState state;
444 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
445 g_return_if_fail(value);
446 WebCore::HTMLIFrameElement* item = WebKit::core(self);
447 WTF::String convertedValue = WTF::String::fromUTF8(value);
448 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr, convertedValue);
449}
450
451gchar* webkit_dom_html_iframe_element_get_name(WebKitDOMHTMLIFrameElement* self)
452{
453 WebCore::JSMainThreadNullState state;
454 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
455 WebCore::HTMLIFrameElement* item = WebKit::core(self);
456 gchar* result = convertToUTF8String(item->getNameAttribute());
457 return result;
458}
459
460void webkit_dom_html_iframe_element_set_name(WebKitDOMHTMLIFrameElement* self, const gchar* value)
461{
462 WebCore::JSMainThreadNullState state;
463 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
464 g_return_if_fail(value);
465 WebCore::HTMLIFrameElement* item = WebKit::core(self);
466 WTF::String convertedValue = WTF::String::fromUTF8(value);
467 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, convertedValue);
468}
469
470gchar* webkit_dom_html_iframe_element_get_scrolling(WebKitDOMHTMLIFrameElement* self)
471{
472 WebCore::JSMainThreadNullState state;
473 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
474 WebCore::HTMLIFrameElement* item = WebKit::core(self);
475 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr));
476 return result;
477}
478
479void webkit_dom_html_iframe_element_set_scrolling(WebKitDOMHTMLIFrameElement* self, const gchar* value)
480{
481 WebCore::JSMainThreadNullState state;
482 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
483 g_return_if_fail(value);
484 WebCore::HTMLIFrameElement* item = WebKit::core(self);
485 WTF::String convertedValue = WTF::String::fromUTF8(value);
486 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr, convertedValue);
487}
488
489gchar* webkit_dom_html_iframe_element_get_src(WebKitDOMHTMLIFrameElement* self)
490{
491 WebCore::JSMainThreadNullState state;
492 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
493 WebCore::HTMLIFrameElement* item = WebKit::core(self);
494 gchar* result = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::srcAttr));
495 return result;
496}
497
498void webkit_dom_html_iframe_element_set_src(WebKitDOMHTMLIFrameElement* self, const gchar* value)
499{
500 WebCore::JSMainThreadNullState state;
501 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
502 g_return_if_fail(value);
503 WebCore::HTMLIFrameElement* item = WebKit::core(self);
504 WTF::String convertedValue = WTF::String::fromUTF8(value);
505 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, convertedValue);
506}
507
508gchar* webkit_dom_html_iframe_element_get_width(WebKitDOMHTMLIFrameElement* self)
509{
510 WebCore::JSMainThreadNullState state;
511 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
512 WebCore::HTMLIFrameElement* item = WebKit::core(self);
513 gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::widthAttr));
514 return result;
515}
516
517void webkit_dom_html_iframe_element_set_width(WebKitDOMHTMLIFrameElement* self, const gchar* value)
518{
519 WebCore::JSMainThreadNullState state;
520 g_return_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self));
521 g_return_if_fail(value);
522 WebCore::HTMLIFrameElement* item = WebKit::core(self);
523 WTF::String convertedValue = WTF::String::fromUTF8(value);
524 item->setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, convertedValue);
525}
526
527WebKitDOMDocument* webkit_dom_html_iframe_element_get_content_document(WebKitDOMHTMLIFrameElement* self)
528{
529 WebCore::JSMainThreadNullState state;
530 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
531 WebCore::HTMLIFrameElement* item = WebKit::core(self);
532 RefPtr<WebCore::Document> gobjectResult = WTF::getPtr(item->contentDocument());
533 return WebKit::kit(gobjectResult.get());
534}
535
536WebKitDOMDOMWindow* webkit_dom_html_iframe_element_get_content_window(WebKitDOMHTMLIFrameElement* self)
537{
538 WebCore::JSMainThreadNullState state;
539 g_return_val_if_fail(WEBKIT_DOM_IS_HTML_IFRAME_ELEMENT(self), 0);
540 WebCore::HTMLIFrameElement* item = WebKit::core(self);
541 return WebKit::kit(item->contentWindow());
542}
543
544G_GNUC_END_IGNORE_DEPRECATIONS;
545