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 "WebKitDOMHTMLFrameElement.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 "WebKitDOMHTMLFrameElementPrivate.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 | WebKitDOMHTMLFrameElement* kit(WebCore::HTMLFrameElement* obj) |
46 | { |
47 | return WEBKIT_DOM_HTML_FRAME_ELEMENT(kit(static_cast<WebCore::Node*>(obj))); |
48 | } |
49 | |
50 | WebCore::HTMLFrameElement* core(WebKitDOMHTMLFrameElement* request) |
51 | { |
52 | return request ? static_cast<WebCore::HTMLFrameElement*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0; |
53 | } |
54 | |
55 | WebKitDOMHTMLFrameElement* wrapHTMLFrameElement(WebCore::HTMLFrameElement* coreObject) |
56 | { |
57 | ASSERT(coreObject); |
58 | return WEBKIT_DOM_HTML_FRAME_ELEMENT(g_object_new(WEBKIT_DOM_TYPE_HTML_FRAME_ELEMENT, "core-object" , coreObject, nullptr)); |
59 | } |
60 | |
61 | } // namespace WebKit |
62 | |
63 | static gboolean webkit_dom_html_frame_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::HTMLFrameElement* coreTarget = static_cast<WebCore::HTMLFrameElement*>(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_frame_element_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
80 | { |
81 | WebCore::HTMLFrameElement* coreTarget = static_cast<WebCore::HTMLFrameElement*>(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_frame_element_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
86 | { |
87 | WebCore::HTMLFrameElement* coreTarget = static_cast<WebCore::HTMLFrameElement*>(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_frame_element_dom_event_target_init(WebKitDOMEventTargetIface* iface) |
92 | { |
93 | iface->dispatch_event = webkit_dom_html_frame_element_dispatch_event; |
94 | iface->add_event_listener = webkit_dom_html_frame_element_add_event_listener; |
95 | iface->remove_event_listener = webkit_dom_html_frame_element_remove_event_listener; |
96 | } |
97 | |
98 | G_DEFINE_TYPE_WITH_CODE(WebKitDOMHTMLFrameElement, webkit_dom_html_frame_element, WEBKIT_DOM_TYPE_HTML_ELEMENT, G_IMPLEMENT_INTERFACE(WEBKIT_DOM_TYPE_EVENT_TARGET, webkit_dom_html_frame_element_dom_event_target_init)) |
99 | |
100 | enum { |
101 | DOM_HTML_FRAME_ELEMENT_PROP_0, |
102 | DOM_HTML_FRAME_ELEMENT_PROP_FRAME_BORDER, |
103 | DOM_HTML_FRAME_ELEMENT_PROP_LONG_DESC, |
104 | DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_HEIGHT, |
105 | DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_WIDTH, |
106 | DOM_HTML_FRAME_ELEMENT_PROP_NAME, |
107 | DOM_HTML_FRAME_ELEMENT_PROP_NO_RESIZE, |
108 | DOM_HTML_FRAME_ELEMENT_PROP_SCROLLING, |
109 | DOM_HTML_FRAME_ELEMENT_PROP_SRC, |
110 | DOM_HTML_FRAME_ELEMENT_PROP_CONTENT_DOCUMENT, |
111 | DOM_HTML_FRAME_ELEMENT_PROP_CONTENT_WINDOW, |
112 | DOM_HTML_FRAME_ELEMENT_PROP_WIDTH, |
113 | DOM_HTML_FRAME_ELEMENT_PROP_HEIGHT, |
114 | }; |
115 | |
116 | static void webkit_dom_html_frame_element_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec) |
117 | { |
118 | WebKitDOMHTMLFrameElement* self = WEBKIT_DOM_HTML_FRAME_ELEMENT(object); |
119 | |
120 | switch (propertyId) { |
121 | case DOM_HTML_FRAME_ELEMENT_PROP_FRAME_BORDER: |
122 | webkit_dom_html_frame_element_set_frame_border(self, g_value_get_string(value)); |
123 | break; |
124 | case DOM_HTML_FRAME_ELEMENT_PROP_LONG_DESC: |
125 | webkit_dom_html_frame_element_set_long_desc(self, g_value_get_string(value)); |
126 | break; |
127 | case DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_HEIGHT: |
128 | webkit_dom_html_frame_element_set_margin_height(self, g_value_get_string(value)); |
129 | break; |
130 | case DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_WIDTH: |
131 | webkit_dom_html_frame_element_set_margin_width(self, g_value_get_string(value)); |
132 | break; |
133 | case DOM_HTML_FRAME_ELEMENT_PROP_NAME: |
134 | webkit_dom_html_frame_element_set_name(self, g_value_get_string(value)); |
135 | break; |
136 | case DOM_HTML_FRAME_ELEMENT_PROP_NO_RESIZE: |
137 | webkit_dom_html_frame_element_set_no_resize(self, g_value_get_boolean(value)); |
138 | break; |
139 | case DOM_HTML_FRAME_ELEMENT_PROP_SCROLLING: |
140 | webkit_dom_html_frame_element_set_scrolling(self, g_value_get_string(value)); |
141 | break; |
142 | case DOM_HTML_FRAME_ELEMENT_PROP_SRC: |
143 | webkit_dom_html_frame_element_set_src(self, g_value_get_string(value)); |
144 | break; |
145 | default: |
146 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
147 | break; |
148 | } |
149 | } |
150 | |
151 | static void webkit_dom_html_frame_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) |
152 | { |
153 | WebKitDOMHTMLFrameElement* self = WEBKIT_DOM_HTML_FRAME_ELEMENT(object); |
154 | |
155 | switch (propertyId) { |
156 | case DOM_HTML_FRAME_ELEMENT_PROP_FRAME_BORDER: |
157 | g_value_take_string(value, webkit_dom_html_frame_element_get_frame_border(self)); |
158 | break; |
159 | case DOM_HTML_FRAME_ELEMENT_PROP_LONG_DESC: |
160 | g_value_take_string(value, webkit_dom_html_frame_element_get_long_desc(self)); |
161 | break; |
162 | case DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_HEIGHT: |
163 | g_value_take_string(value, webkit_dom_html_frame_element_get_margin_height(self)); |
164 | break; |
165 | case DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_WIDTH: |
166 | g_value_take_string(value, webkit_dom_html_frame_element_get_margin_width(self)); |
167 | break; |
168 | case DOM_HTML_FRAME_ELEMENT_PROP_NAME: |
169 | g_value_take_string(value, webkit_dom_html_frame_element_get_name(self)); |
170 | break; |
171 | case DOM_HTML_FRAME_ELEMENT_PROP_NO_RESIZE: |
172 | g_value_set_boolean(value, webkit_dom_html_frame_element_get_no_resize(self)); |
173 | break; |
174 | case DOM_HTML_FRAME_ELEMENT_PROP_SCROLLING: |
175 | g_value_take_string(value, webkit_dom_html_frame_element_get_scrolling(self)); |
176 | break; |
177 | case DOM_HTML_FRAME_ELEMENT_PROP_SRC: |
178 | g_value_take_string(value, webkit_dom_html_frame_element_get_src(self)); |
179 | break; |
180 | case DOM_HTML_FRAME_ELEMENT_PROP_CONTENT_DOCUMENT: |
181 | g_value_set_object(value, webkit_dom_html_frame_element_get_content_document(self)); |
182 | break; |
183 | case DOM_HTML_FRAME_ELEMENT_PROP_CONTENT_WINDOW: |
184 | g_value_set_object(value, webkit_dom_html_frame_element_get_content_window(self)); |
185 | break; |
186 | case DOM_HTML_FRAME_ELEMENT_PROP_WIDTH: |
187 | g_value_set_long(value, webkit_dom_html_frame_element_get_width(self)); |
188 | break; |
189 | case DOM_HTML_FRAME_ELEMENT_PROP_HEIGHT: |
190 | g_value_set_long(value, webkit_dom_html_frame_element_get_height(self)); |
191 | break; |
192 | default: |
193 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
194 | break; |
195 | } |
196 | } |
197 | |
198 | static void webkit_dom_html_frame_element_class_init(WebKitDOMHTMLFrameElementClass* requestClass) |
199 | { |
200 | GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass); |
201 | gobjectClass->set_property = webkit_dom_html_frame_element_set_property; |
202 | gobjectClass->get_property = webkit_dom_html_frame_element_get_property; |
203 | |
204 | g_object_class_install_property( |
205 | gobjectClass, |
206 | DOM_HTML_FRAME_ELEMENT_PROP_FRAME_BORDER, |
207 | g_param_spec_string( |
208 | "frame-border" , |
209 | "HTMLFrameElement:frame-border" , |
210 | "read-write gchar* HTMLFrameElement:frame-border" , |
211 | "" , |
212 | WEBKIT_PARAM_READWRITE)); |
213 | |
214 | g_object_class_install_property( |
215 | gobjectClass, |
216 | DOM_HTML_FRAME_ELEMENT_PROP_LONG_DESC, |
217 | g_param_spec_string( |
218 | "long-desc" , |
219 | "HTMLFrameElement:long-desc" , |
220 | "read-write gchar* HTMLFrameElement:long-desc" , |
221 | "" , |
222 | WEBKIT_PARAM_READWRITE)); |
223 | |
224 | g_object_class_install_property( |
225 | gobjectClass, |
226 | DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_HEIGHT, |
227 | g_param_spec_string( |
228 | "margin-height" , |
229 | "HTMLFrameElement:margin-height" , |
230 | "read-write gchar* HTMLFrameElement:margin-height" , |
231 | "" , |
232 | WEBKIT_PARAM_READWRITE)); |
233 | |
234 | g_object_class_install_property( |
235 | gobjectClass, |
236 | DOM_HTML_FRAME_ELEMENT_PROP_MARGIN_WIDTH, |
237 | g_param_spec_string( |
238 | "margin-width" , |
239 | "HTMLFrameElement:margin-width" , |
240 | "read-write gchar* HTMLFrameElement:margin-width" , |
241 | "" , |
242 | WEBKIT_PARAM_READWRITE)); |
243 | |
244 | g_object_class_install_property( |
245 | gobjectClass, |
246 | DOM_HTML_FRAME_ELEMENT_PROP_NAME, |
247 | g_param_spec_string( |
248 | "name" , |
249 | "HTMLFrameElement:name" , |
250 | "read-write gchar* HTMLFrameElement:name" , |
251 | "" , |
252 | WEBKIT_PARAM_READWRITE)); |
253 | |
254 | g_object_class_install_property( |
255 | gobjectClass, |
256 | DOM_HTML_FRAME_ELEMENT_PROP_NO_RESIZE, |
257 | g_param_spec_boolean( |
258 | "no-resize" , |
259 | "HTMLFrameElement:no-resize" , |
260 | "read-write gboolean HTMLFrameElement:no-resize" , |
261 | FALSE, |
262 | WEBKIT_PARAM_READWRITE)); |
263 | |
264 | g_object_class_install_property( |
265 | gobjectClass, |
266 | DOM_HTML_FRAME_ELEMENT_PROP_SCROLLING, |
267 | g_param_spec_string( |
268 | "scrolling" , |
269 | "HTMLFrameElement:scrolling" , |
270 | "read-write gchar* HTMLFrameElement:scrolling" , |
271 | "" , |
272 | WEBKIT_PARAM_READWRITE)); |
273 | |
274 | g_object_class_install_property( |
275 | gobjectClass, |
276 | DOM_HTML_FRAME_ELEMENT_PROP_SRC, |
277 | g_param_spec_string( |
278 | "src" , |
279 | "HTMLFrameElement:src" , |
280 | "read-write gchar* HTMLFrameElement:src" , |
281 | "" , |
282 | WEBKIT_PARAM_READWRITE)); |
283 | |
284 | g_object_class_install_property( |
285 | gobjectClass, |
286 | DOM_HTML_FRAME_ELEMENT_PROP_CONTENT_DOCUMENT, |
287 | g_param_spec_object( |
288 | "content-document" , |
289 | "HTMLFrameElement:content-document" , |
290 | "read-only WebKitDOMDocument* HTMLFrameElement:content-document" , |
291 | WEBKIT_DOM_TYPE_DOCUMENT, |
292 | WEBKIT_PARAM_READABLE)); |
293 | |
294 | g_object_class_install_property( |
295 | gobjectClass, |
296 | DOM_HTML_FRAME_ELEMENT_PROP_CONTENT_WINDOW, |
297 | g_param_spec_object( |
298 | "content-window" , |
299 | "HTMLFrameElement:content-window" , |
300 | "read-only WebKitDOMDOMWindow* HTMLFrameElement:content-window" , |
301 | WEBKIT_DOM_TYPE_DOM_WINDOW, |
302 | WEBKIT_PARAM_READABLE)); |
303 | |
304 | g_object_class_install_property( |
305 | gobjectClass, |
306 | DOM_HTML_FRAME_ELEMENT_PROP_WIDTH, |
307 | g_param_spec_long( |
308 | "width" , |
309 | "HTMLFrameElement:width" , |
310 | "read-only glong HTMLFrameElement:width" , |
311 | G_MINLONG, G_MAXLONG, 0, |
312 | WEBKIT_PARAM_READABLE)); |
313 | |
314 | g_object_class_install_property( |
315 | gobjectClass, |
316 | DOM_HTML_FRAME_ELEMENT_PROP_HEIGHT, |
317 | g_param_spec_long( |
318 | "height" , |
319 | "HTMLFrameElement:height" , |
320 | "read-only glong HTMLFrameElement:height" , |
321 | G_MINLONG, G_MAXLONG, 0, |
322 | WEBKIT_PARAM_READABLE)); |
323 | |
324 | } |
325 | |
326 | static void webkit_dom_html_frame_element_init(WebKitDOMHTMLFrameElement* request) |
327 | { |
328 | UNUSED_PARAM(request); |
329 | } |
330 | |
331 | gchar* webkit_dom_html_frame_element_get_frame_border(WebKitDOMHTMLFrameElement* self) |
332 | { |
333 | WebCore::JSMainThreadNullState state; |
334 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
335 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
336 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr)); |
337 | return result; |
338 | } |
339 | |
340 | void webkit_dom_html_frame_element_set_frame_border(WebKitDOMHTMLFrameElement* self, const gchar* value) |
341 | { |
342 | WebCore::JSMainThreadNullState state; |
343 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
344 | g_return_if_fail(value); |
345 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
346 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
347 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::frameborderAttr, convertedValue); |
348 | } |
349 | |
350 | gchar* webkit_dom_html_frame_element_get_long_desc(WebKitDOMHTMLFrameElement* self) |
351 | { |
352 | WebCore::JSMainThreadNullState state; |
353 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
354 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
355 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::longdescAttr)); |
356 | return result; |
357 | } |
358 | |
359 | void webkit_dom_html_frame_element_set_long_desc(WebKitDOMHTMLFrameElement* self, const gchar* value) |
360 | { |
361 | WebCore::JSMainThreadNullState state; |
362 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
363 | g_return_if_fail(value); |
364 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
365 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
366 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::longdescAttr, convertedValue); |
367 | } |
368 | |
369 | gchar* webkit_dom_html_frame_element_get_margin_height(WebKitDOMHTMLFrameElement* self) |
370 | { |
371 | WebCore::JSMainThreadNullState state; |
372 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
373 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
374 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr)); |
375 | return result; |
376 | } |
377 | |
378 | void webkit_dom_html_frame_element_set_margin_height(WebKitDOMHTMLFrameElement* self, const gchar* value) |
379 | { |
380 | WebCore::JSMainThreadNullState state; |
381 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
382 | g_return_if_fail(value); |
383 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
384 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
385 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::marginheightAttr, convertedValue); |
386 | } |
387 | |
388 | gchar* webkit_dom_html_frame_element_get_margin_width(WebKitDOMHTMLFrameElement* self) |
389 | { |
390 | WebCore::JSMainThreadNullState state; |
391 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
392 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
393 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr)); |
394 | return result; |
395 | } |
396 | |
397 | void webkit_dom_html_frame_element_set_margin_width(WebKitDOMHTMLFrameElement* self, const gchar* value) |
398 | { |
399 | WebCore::JSMainThreadNullState state; |
400 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
401 | g_return_if_fail(value); |
402 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
403 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
404 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::marginwidthAttr, convertedValue); |
405 | } |
406 | |
407 | gchar* webkit_dom_html_frame_element_get_name(WebKitDOMHTMLFrameElement* self) |
408 | { |
409 | WebCore::JSMainThreadNullState state; |
410 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
411 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
412 | gchar* result = convertToUTF8String(item->getNameAttribute()); |
413 | return result; |
414 | } |
415 | |
416 | void webkit_dom_html_frame_element_set_name(WebKitDOMHTMLFrameElement* self, const gchar* value) |
417 | { |
418 | WebCore::JSMainThreadNullState state; |
419 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
420 | g_return_if_fail(value); |
421 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
422 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
423 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::nameAttr, convertedValue); |
424 | } |
425 | |
426 | gboolean webkit_dom_html_frame_element_get_no_resize(WebKitDOMHTMLFrameElement* self) |
427 | { |
428 | WebCore::JSMainThreadNullState state; |
429 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), FALSE); |
430 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
431 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::noresizeAttr); |
432 | return result; |
433 | } |
434 | |
435 | void webkit_dom_html_frame_element_set_no_resize(WebKitDOMHTMLFrameElement* self, gboolean value) |
436 | { |
437 | WebCore::JSMainThreadNullState state; |
438 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
439 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
440 | item->setBooleanAttribute(WebCore::HTMLNames::noresizeAttr, value); |
441 | } |
442 | |
443 | gchar* webkit_dom_html_frame_element_get_scrolling(WebKitDOMHTMLFrameElement* self) |
444 | { |
445 | WebCore::JSMainThreadNullState state; |
446 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
447 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
448 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr)); |
449 | return result; |
450 | } |
451 | |
452 | void webkit_dom_html_frame_element_set_scrolling(WebKitDOMHTMLFrameElement* self, const gchar* value) |
453 | { |
454 | WebCore::JSMainThreadNullState state; |
455 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
456 | g_return_if_fail(value); |
457 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
458 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
459 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::scrollingAttr, convertedValue); |
460 | } |
461 | |
462 | gchar* webkit_dom_html_frame_element_get_src(WebKitDOMHTMLFrameElement* self) |
463 | { |
464 | WebCore::JSMainThreadNullState state; |
465 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
466 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
467 | gchar* result = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::srcAttr)); |
468 | return result; |
469 | } |
470 | |
471 | void webkit_dom_html_frame_element_set_src(WebKitDOMHTMLFrameElement* self, const gchar* value) |
472 | { |
473 | WebCore::JSMainThreadNullState state; |
474 | g_return_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self)); |
475 | g_return_if_fail(value); |
476 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
477 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
478 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::srcAttr, convertedValue); |
479 | } |
480 | |
481 | WebKitDOMDocument* webkit_dom_html_frame_element_get_content_document(WebKitDOMHTMLFrameElement* self) |
482 | { |
483 | WebCore::JSMainThreadNullState state; |
484 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
485 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
486 | RefPtr<WebCore::Document> gobjectResult = WTF::getPtr(item->contentDocument()); |
487 | return WebKit::kit(gobjectResult.get()); |
488 | } |
489 | |
490 | WebKitDOMDOMWindow* webkit_dom_html_frame_element_get_content_window(WebKitDOMHTMLFrameElement* self) |
491 | { |
492 | WebCore::JSMainThreadNullState state; |
493 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
494 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
495 | return WebKit::kit(item->contentWindow()); |
496 | } |
497 | |
498 | glong webkit_dom_html_frame_element_get_width(WebKitDOMHTMLFrameElement* self) |
499 | { |
500 | WebCore::JSMainThreadNullState state; |
501 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
502 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
503 | glong result = item->width(); |
504 | return result; |
505 | } |
506 | |
507 | glong webkit_dom_html_frame_element_get_height(WebKitDOMHTMLFrameElement* self) |
508 | { |
509 | WebCore::JSMainThreadNullState state; |
510 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_FRAME_ELEMENT(self), 0); |
511 | WebCore::HTMLFrameElement* item = WebKit::core(self); |
512 | glong result = item->height(); |
513 | return result; |
514 | } |
515 | |
516 | G_GNUC_END_IGNORE_DEPRECATIONS; |
517 | |