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 "WebKitDOMHTMLAreaElement.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 "WebKitDOMDOMTokenListPrivate.h" |
31 | #include "WebKitDOMEventPrivate.h" |
32 | #include "WebKitDOMEventTarget.h" |
33 | #include "WebKitDOMHTMLAreaElementPrivate.h" |
34 | #include "WebKitDOMNodePrivate.h" |
35 | #include "WebKitDOMPrivate.h" |
36 | #include "ConvertToUTF8String.h" |
37 | #include <wtf/GetPtr.h> |
38 | #include <wtf/RefPtr.h> |
39 | |
40 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS; |
41 | |
42 | namespace WebKit { |
43 | |
44 | WebKitDOMHTMLAreaElement* kit(WebCore::HTMLAreaElement* obj) |
45 | { |
46 | return WEBKIT_DOM_HTML_AREA_ELEMENT(kit(static_cast<WebCore::Node*>(obj))); |
47 | } |
48 | |
49 | WebCore::HTMLAreaElement* core(WebKitDOMHTMLAreaElement* request) |
50 | { |
51 | return request ? static_cast<WebCore::HTMLAreaElement*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0; |
52 | } |
53 | |
54 | WebKitDOMHTMLAreaElement* wrapHTMLAreaElement(WebCore::HTMLAreaElement* coreObject) |
55 | { |
56 | ASSERT(coreObject); |
57 | return WEBKIT_DOM_HTML_AREA_ELEMENT(g_object_new(WEBKIT_DOM_TYPE_HTML_AREA_ELEMENT, "core-object" , coreObject, nullptr)); |
58 | } |
59 | |
60 | } // namespace WebKit |
61 | |
62 | static gboolean webkit_dom_html_area_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::HTMLAreaElement* coreTarget = static_cast<WebCore::HTMLAreaElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
68 | |
69 | auto result = coreTarget->dispatchEventForBindings(*coreEvent); |
70 | if (result.hasException()) { |
71 | auto description = WebCore::DOMException::description(result.releaseException().code()); |
72 | g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM" ), description.legacyCode, description.name); |
73 | return false; |
74 | } |
75 | return result.releaseReturnValue(); |
76 | } |
77 | |
78 | static gboolean webkit_dom_html_area_element_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
79 | { |
80 | WebCore::HTMLAreaElement* coreTarget = static_cast<WebCore::HTMLAreaElement*>(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_area_element_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
85 | { |
86 | WebCore::HTMLAreaElement* coreTarget = static_cast<WebCore::HTMLAreaElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
87 | return WebKit::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture); |
88 | } |
89 | |
90 | static void webkit_dom_html_area_element_dom_event_target_init(WebKitDOMEventTargetIface* iface) |
91 | { |
92 | iface->dispatch_event = webkit_dom_html_area_element_dispatch_event; |
93 | iface->add_event_listener = webkit_dom_html_area_element_add_event_listener; |
94 | iface->remove_event_listener = webkit_dom_html_area_element_remove_event_listener; |
95 | } |
96 | |
97 | G_DEFINE_TYPE_WITH_CODE(WebKitDOMHTMLAreaElement, webkit_dom_html_area_element, WEBKIT_DOM_TYPE_HTML_ELEMENT, G_IMPLEMENT_INTERFACE(WEBKIT_DOM_TYPE_EVENT_TARGET, webkit_dom_html_area_element_dom_event_target_init)) |
98 | |
99 | enum { |
100 | DOM_HTML_AREA_ELEMENT_PROP_0, |
101 | DOM_HTML_AREA_ELEMENT_PROP_ALT, |
102 | DOM_HTML_AREA_ELEMENT_PROP_COORDS, |
103 | DOM_HTML_AREA_ELEMENT_PROP_NO_HREF, |
104 | DOM_HTML_AREA_ELEMENT_PROP_SHAPE, |
105 | DOM_HTML_AREA_ELEMENT_PROP_TARGET, |
106 | DOM_HTML_AREA_ELEMENT_PROP_HREF, |
107 | DOM_HTML_AREA_ELEMENT_PROP_PROTOCOL, |
108 | DOM_HTML_AREA_ELEMENT_PROP_HOST, |
109 | DOM_HTML_AREA_ELEMENT_PROP_HOSTNAME, |
110 | DOM_HTML_AREA_ELEMENT_PROP_PORT, |
111 | DOM_HTML_AREA_ELEMENT_PROP_PATHNAME, |
112 | DOM_HTML_AREA_ELEMENT_PROP_SEARCH, |
113 | DOM_HTML_AREA_ELEMENT_PROP_HASH, |
114 | }; |
115 | |
116 | static void webkit_dom_html_area_element_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec) |
117 | { |
118 | WebKitDOMHTMLAreaElement* self = WEBKIT_DOM_HTML_AREA_ELEMENT(object); |
119 | |
120 | switch (propertyId) { |
121 | case DOM_HTML_AREA_ELEMENT_PROP_ALT: |
122 | webkit_dom_html_area_element_set_alt(self, g_value_get_string(value)); |
123 | break; |
124 | case DOM_HTML_AREA_ELEMENT_PROP_COORDS: |
125 | webkit_dom_html_area_element_set_coords(self, g_value_get_string(value)); |
126 | break; |
127 | case DOM_HTML_AREA_ELEMENT_PROP_NO_HREF: |
128 | webkit_dom_html_area_element_set_no_href(self, g_value_get_boolean(value)); |
129 | break; |
130 | case DOM_HTML_AREA_ELEMENT_PROP_SHAPE: |
131 | webkit_dom_html_area_element_set_shape(self, g_value_get_string(value)); |
132 | break; |
133 | case DOM_HTML_AREA_ELEMENT_PROP_TARGET: |
134 | webkit_dom_html_area_element_set_target(self, g_value_get_string(value)); |
135 | break; |
136 | case DOM_HTML_AREA_ELEMENT_PROP_HREF: |
137 | webkit_dom_html_area_element_set_href(self, g_value_get_string(value)); |
138 | break; |
139 | case DOM_HTML_AREA_ELEMENT_PROP_PROTOCOL: |
140 | webkit_dom_html_area_element_set_protocol(self, g_value_get_string(value)); |
141 | break; |
142 | case DOM_HTML_AREA_ELEMENT_PROP_HOST: |
143 | webkit_dom_html_area_element_set_host(self, g_value_get_string(value)); |
144 | break; |
145 | case DOM_HTML_AREA_ELEMENT_PROP_HOSTNAME: |
146 | webkit_dom_html_area_element_set_hostname(self, g_value_get_string(value)); |
147 | break; |
148 | case DOM_HTML_AREA_ELEMENT_PROP_PORT: |
149 | webkit_dom_html_area_element_set_port(self, g_value_get_string(value)); |
150 | break; |
151 | case DOM_HTML_AREA_ELEMENT_PROP_PATHNAME: |
152 | webkit_dom_html_area_element_set_pathname(self, g_value_get_string(value)); |
153 | break; |
154 | case DOM_HTML_AREA_ELEMENT_PROP_SEARCH: |
155 | webkit_dom_html_area_element_set_search(self, g_value_get_string(value)); |
156 | break; |
157 | case DOM_HTML_AREA_ELEMENT_PROP_HASH: |
158 | webkit_dom_html_area_element_set_hash(self, g_value_get_string(value)); |
159 | break; |
160 | default: |
161 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
162 | break; |
163 | } |
164 | } |
165 | |
166 | static void webkit_dom_html_area_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) |
167 | { |
168 | WebKitDOMHTMLAreaElement* self = WEBKIT_DOM_HTML_AREA_ELEMENT(object); |
169 | |
170 | switch (propertyId) { |
171 | case DOM_HTML_AREA_ELEMENT_PROP_ALT: |
172 | g_value_take_string(value, webkit_dom_html_area_element_get_alt(self)); |
173 | break; |
174 | case DOM_HTML_AREA_ELEMENT_PROP_COORDS: |
175 | g_value_take_string(value, webkit_dom_html_area_element_get_coords(self)); |
176 | break; |
177 | case DOM_HTML_AREA_ELEMENT_PROP_NO_HREF: |
178 | g_value_set_boolean(value, webkit_dom_html_area_element_get_no_href(self)); |
179 | break; |
180 | case DOM_HTML_AREA_ELEMENT_PROP_SHAPE: |
181 | g_value_take_string(value, webkit_dom_html_area_element_get_shape(self)); |
182 | break; |
183 | case DOM_HTML_AREA_ELEMENT_PROP_TARGET: |
184 | g_value_take_string(value, webkit_dom_html_area_element_get_target(self)); |
185 | break; |
186 | case DOM_HTML_AREA_ELEMENT_PROP_HREF: |
187 | g_value_take_string(value, webkit_dom_html_area_element_get_href(self)); |
188 | break; |
189 | case DOM_HTML_AREA_ELEMENT_PROP_PROTOCOL: |
190 | g_value_take_string(value, webkit_dom_html_area_element_get_protocol(self)); |
191 | break; |
192 | case DOM_HTML_AREA_ELEMENT_PROP_HOST: |
193 | g_value_take_string(value, webkit_dom_html_area_element_get_host(self)); |
194 | break; |
195 | case DOM_HTML_AREA_ELEMENT_PROP_HOSTNAME: |
196 | g_value_take_string(value, webkit_dom_html_area_element_get_hostname(self)); |
197 | break; |
198 | case DOM_HTML_AREA_ELEMENT_PROP_PORT: |
199 | g_value_take_string(value, webkit_dom_html_area_element_get_port(self)); |
200 | break; |
201 | case DOM_HTML_AREA_ELEMENT_PROP_PATHNAME: |
202 | g_value_take_string(value, webkit_dom_html_area_element_get_pathname(self)); |
203 | break; |
204 | case DOM_HTML_AREA_ELEMENT_PROP_SEARCH: |
205 | g_value_take_string(value, webkit_dom_html_area_element_get_search(self)); |
206 | break; |
207 | case DOM_HTML_AREA_ELEMENT_PROP_HASH: |
208 | g_value_take_string(value, webkit_dom_html_area_element_get_hash(self)); |
209 | break; |
210 | default: |
211 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
212 | break; |
213 | } |
214 | } |
215 | |
216 | static void webkit_dom_html_area_element_class_init(WebKitDOMHTMLAreaElementClass* requestClass) |
217 | { |
218 | GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass); |
219 | gobjectClass->set_property = webkit_dom_html_area_element_set_property; |
220 | gobjectClass->get_property = webkit_dom_html_area_element_get_property; |
221 | |
222 | g_object_class_install_property( |
223 | gobjectClass, |
224 | DOM_HTML_AREA_ELEMENT_PROP_ALT, |
225 | g_param_spec_string( |
226 | "alt" , |
227 | "HTMLAreaElement:alt" , |
228 | "read-write gchar* HTMLAreaElement:alt" , |
229 | "" , |
230 | WEBKIT_PARAM_READWRITE)); |
231 | |
232 | g_object_class_install_property( |
233 | gobjectClass, |
234 | DOM_HTML_AREA_ELEMENT_PROP_COORDS, |
235 | g_param_spec_string( |
236 | "coords" , |
237 | "HTMLAreaElement:coords" , |
238 | "read-write gchar* HTMLAreaElement:coords" , |
239 | "" , |
240 | WEBKIT_PARAM_READWRITE)); |
241 | |
242 | g_object_class_install_property( |
243 | gobjectClass, |
244 | DOM_HTML_AREA_ELEMENT_PROP_NO_HREF, |
245 | g_param_spec_boolean( |
246 | "no-href" , |
247 | "HTMLAreaElement:no-href" , |
248 | "read-write gboolean HTMLAreaElement:no-href" , |
249 | FALSE, |
250 | WEBKIT_PARAM_READWRITE)); |
251 | |
252 | g_object_class_install_property( |
253 | gobjectClass, |
254 | DOM_HTML_AREA_ELEMENT_PROP_SHAPE, |
255 | g_param_spec_string( |
256 | "shape" , |
257 | "HTMLAreaElement:shape" , |
258 | "read-write gchar* HTMLAreaElement:shape" , |
259 | "" , |
260 | WEBKIT_PARAM_READWRITE)); |
261 | |
262 | g_object_class_install_property( |
263 | gobjectClass, |
264 | DOM_HTML_AREA_ELEMENT_PROP_TARGET, |
265 | g_param_spec_string( |
266 | "target" , |
267 | "HTMLAreaElement:target" , |
268 | "read-write gchar* HTMLAreaElement:target" , |
269 | "" , |
270 | WEBKIT_PARAM_READWRITE)); |
271 | |
272 | g_object_class_install_property( |
273 | gobjectClass, |
274 | DOM_HTML_AREA_ELEMENT_PROP_HREF, |
275 | g_param_spec_string( |
276 | "href" , |
277 | "HTMLAreaElement:href" , |
278 | "read-write gchar* HTMLAreaElement:href" , |
279 | "" , |
280 | WEBKIT_PARAM_READWRITE)); |
281 | |
282 | g_object_class_install_property( |
283 | gobjectClass, |
284 | DOM_HTML_AREA_ELEMENT_PROP_PROTOCOL, |
285 | g_param_spec_string( |
286 | "protocol" , |
287 | "HTMLAreaElement:protocol" , |
288 | "read-write gchar* HTMLAreaElement:protocol" , |
289 | "" , |
290 | WEBKIT_PARAM_READWRITE)); |
291 | |
292 | g_object_class_install_property( |
293 | gobjectClass, |
294 | DOM_HTML_AREA_ELEMENT_PROP_HOST, |
295 | g_param_spec_string( |
296 | "host" , |
297 | "HTMLAreaElement:host" , |
298 | "read-write gchar* HTMLAreaElement:host" , |
299 | "" , |
300 | WEBKIT_PARAM_READWRITE)); |
301 | |
302 | g_object_class_install_property( |
303 | gobjectClass, |
304 | DOM_HTML_AREA_ELEMENT_PROP_HOSTNAME, |
305 | g_param_spec_string( |
306 | "hostname" , |
307 | "HTMLAreaElement:hostname" , |
308 | "read-write gchar* HTMLAreaElement:hostname" , |
309 | "" , |
310 | WEBKIT_PARAM_READWRITE)); |
311 | |
312 | g_object_class_install_property( |
313 | gobjectClass, |
314 | DOM_HTML_AREA_ELEMENT_PROP_PORT, |
315 | g_param_spec_string( |
316 | "port" , |
317 | "HTMLAreaElement:port" , |
318 | "read-write gchar* HTMLAreaElement:port" , |
319 | "" , |
320 | WEBKIT_PARAM_READWRITE)); |
321 | |
322 | g_object_class_install_property( |
323 | gobjectClass, |
324 | DOM_HTML_AREA_ELEMENT_PROP_PATHNAME, |
325 | g_param_spec_string( |
326 | "pathname" , |
327 | "HTMLAreaElement:pathname" , |
328 | "read-write gchar* HTMLAreaElement:pathname" , |
329 | "" , |
330 | WEBKIT_PARAM_READWRITE)); |
331 | |
332 | g_object_class_install_property( |
333 | gobjectClass, |
334 | DOM_HTML_AREA_ELEMENT_PROP_SEARCH, |
335 | g_param_spec_string( |
336 | "search" , |
337 | "HTMLAreaElement:search" , |
338 | "read-write gchar* HTMLAreaElement:search" , |
339 | "" , |
340 | WEBKIT_PARAM_READWRITE)); |
341 | |
342 | g_object_class_install_property( |
343 | gobjectClass, |
344 | DOM_HTML_AREA_ELEMENT_PROP_HASH, |
345 | g_param_spec_string( |
346 | "hash" , |
347 | "HTMLAreaElement:hash" , |
348 | "read-write gchar* HTMLAreaElement:hash" , |
349 | "" , |
350 | WEBKIT_PARAM_READWRITE)); |
351 | |
352 | } |
353 | |
354 | static void webkit_dom_html_area_element_init(WebKitDOMHTMLAreaElement* request) |
355 | { |
356 | UNUSED_PARAM(request); |
357 | } |
358 | |
359 | gchar* webkit_dom_html_area_element_get_alt(WebKitDOMHTMLAreaElement* self) |
360 | { |
361 | WebCore::JSMainThreadNullState state; |
362 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
363 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
364 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::altAttr)); |
365 | return result; |
366 | } |
367 | |
368 | void webkit_dom_html_area_element_set_alt(WebKitDOMHTMLAreaElement* self, const gchar* value) |
369 | { |
370 | WebCore::JSMainThreadNullState state; |
371 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
372 | g_return_if_fail(value); |
373 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
374 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
375 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::altAttr, convertedValue); |
376 | } |
377 | |
378 | gchar* webkit_dom_html_area_element_get_coords(WebKitDOMHTMLAreaElement* self) |
379 | { |
380 | WebCore::JSMainThreadNullState state; |
381 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
382 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
383 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::coordsAttr)); |
384 | return result; |
385 | } |
386 | |
387 | void webkit_dom_html_area_element_set_coords(WebKitDOMHTMLAreaElement* self, const gchar* value) |
388 | { |
389 | WebCore::JSMainThreadNullState state; |
390 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
391 | g_return_if_fail(value); |
392 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
393 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
394 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::coordsAttr, convertedValue); |
395 | } |
396 | |
397 | gboolean webkit_dom_html_area_element_get_no_href(WebKitDOMHTMLAreaElement* self) |
398 | { |
399 | WebCore::JSMainThreadNullState state; |
400 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), FALSE); |
401 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
402 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::nohrefAttr); |
403 | return result; |
404 | } |
405 | |
406 | void webkit_dom_html_area_element_set_no_href(WebKitDOMHTMLAreaElement* self, gboolean value) |
407 | { |
408 | WebCore::JSMainThreadNullState state; |
409 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
410 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
411 | item->setBooleanAttribute(WebCore::HTMLNames::nohrefAttr, value); |
412 | } |
413 | |
414 | gchar* webkit_dom_html_area_element_get_shape(WebKitDOMHTMLAreaElement* self) |
415 | { |
416 | WebCore::JSMainThreadNullState state; |
417 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
418 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
419 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::shapeAttr)); |
420 | return result; |
421 | } |
422 | |
423 | void webkit_dom_html_area_element_set_shape(WebKitDOMHTMLAreaElement* self, const gchar* value) |
424 | { |
425 | WebCore::JSMainThreadNullState state; |
426 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
427 | g_return_if_fail(value); |
428 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
429 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
430 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::shapeAttr, convertedValue); |
431 | } |
432 | |
433 | gchar* webkit_dom_html_area_element_get_target(WebKitDOMHTMLAreaElement* self) |
434 | { |
435 | WebCore::JSMainThreadNullState state; |
436 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
437 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
438 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::targetAttr)); |
439 | return result; |
440 | } |
441 | |
442 | void webkit_dom_html_area_element_set_target(WebKitDOMHTMLAreaElement* self, const gchar* value) |
443 | { |
444 | WebCore::JSMainThreadNullState state; |
445 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
446 | g_return_if_fail(value); |
447 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
448 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
449 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::targetAttr, convertedValue); |
450 | } |
451 | |
452 | gchar* webkit_dom_html_area_element_get_href(WebKitDOMHTMLAreaElement* self) |
453 | { |
454 | WebCore::JSMainThreadNullState state; |
455 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
456 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
457 | gchar* result = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::hrefAttr)); |
458 | return result; |
459 | } |
460 | |
461 | void webkit_dom_html_area_element_set_href(WebKitDOMHTMLAreaElement* self, const gchar* value) |
462 | { |
463 | WebCore::JSMainThreadNullState state; |
464 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
465 | g_return_if_fail(value); |
466 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
467 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
468 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::hrefAttr, convertedValue); |
469 | } |
470 | |
471 | gchar* webkit_dom_html_area_element_get_protocol(WebKitDOMHTMLAreaElement* self) |
472 | { |
473 | WebCore::JSMainThreadNullState state; |
474 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
475 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
476 | gchar* result = convertToUTF8String(item->protocol()); |
477 | return result; |
478 | } |
479 | |
480 | void webkit_dom_html_area_element_set_protocol(WebKitDOMHTMLAreaElement* self, const gchar* value) |
481 | { |
482 | WebCore::JSMainThreadNullState state; |
483 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
484 | g_return_if_fail(value); |
485 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
486 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
487 | item->setProtocol(convertedValue); |
488 | } |
489 | |
490 | gchar* webkit_dom_html_area_element_get_host(WebKitDOMHTMLAreaElement* self) |
491 | { |
492 | WebCore::JSMainThreadNullState state; |
493 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
494 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
495 | gchar* result = convertToUTF8String(item->host()); |
496 | return result; |
497 | } |
498 | |
499 | void webkit_dom_html_area_element_set_host(WebKitDOMHTMLAreaElement* self, const gchar* value) |
500 | { |
501 | WebCore::JSMainThreadNullState state; |
502 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
503 | g_return_if_fail(value); |
504 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
505 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
506 | item->setHost(convertedValue); |
507 | } |
508 | |
509 | gchar* webkit_dom_html_area_element_get_hostname(WebKitDOMHTMLAreaElement* self) |
510 | { |
511 | WebCore::JSMainThreadNullState state; |
512 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
513 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
514 | gchar* result = convertToUTF8String(item->hostname()); |
515 | return result; |
516 | } |
517 | |
518 | void webkit_dom_html_area_element_set_hostname(WebKitDOMHTMLAreaElement* self, const gchar* value) |
519 | { |
520 | WebCore::JSMainThreadNullState state; |
521 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
522 | g_return_if_fail(value); |
523 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
524 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
525 | item->setHostname(convertedValue); |
526 | } |
527 | |
528 | gchar* webkit_dom_html_area_element_get_port(WebKitDOMHTMLAreaElement* self) |
529 | { |
530 | WebCore::JSMainThreadNullState state; |
531 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
532 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
533 | gchar* result = convertToUTF8String(item->port()); |
534 | return result; |
535 | } |
536 | |
537 | void webkit_dom_html_area_element_set_port(WebKitDOMHTMLAreaElement* self, const gchar* value) |
538 | { |
539 | WebCore::JSMainThreadNullState state; |
540 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
541 | g_return_if_fail(value); |
542 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
543 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
544 | item->setPort(convertedValue); |
545 | } |
546 | |
547 | gchar* webkit_dom_html_area_element_get_pathname(WebKitDOMHTMLAreaElement* self) |
548 | { |
549 | WebCore::JSMainThreadNullState state; |
550 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
551 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
552 | gchar* result = convertToUTF8String(item->pathname()); |
553 | return result; |
554 | } |
555 | |
556 | void webkit_dom_html_area_element_set_pathname(WebKitDOMHTMLAreaElement* self, const gchar* value) |
557 | { |
558 | WebCore::JSMainThreadNullState state; |
559 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
560 | g_return_if_fail(value); |
561 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
562 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
563 | item->setPathname(convertedValue); |
564 | } |
565 | |
566 | gchar* webkit_dom_html_area_element_get_search(WebKitDOMHTMLAreaElement* self) |
567 | { |
568 | WebCore::JSMainThreadNullState state; |
569 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
570 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
571 | gchar* result = convertToUTF8String(item->search()); |
572 | return result; |
573 | } |
574 | |
575 | void webkit_dom_html_area_element_set_search(WebKitDOMHTMLAreaElement* self, const gchar* value) |
576 | { |
577 | WebCore::JSMainThreadNullState state; |
578 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
579 | g_return_if_fail(value); |
580 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
581 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
582 | item->setSearch(convertedValue); |
583 | } |
584 | |
585 | gchar* webkit_dom_html_area_element_get_hash(WebKitDOMHTMLAreaElement* self) |
586 | { |
587 | WebCore::JSMainThreadNullState state; |
588 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self), 0); |
589 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
590 | gchar* result = convertToUTF8String(item->hash()); |
591 | return result; |
592 | } |
593 | |
594 | void webkit_dom_html_area_element_set_hash(WebKitDOMHTMLAreaElement* self, const gchar* value) |
595 | { |
596 | WebCore::JSMainThreadNullState state; |
597 | g_return_if_fail(WEBKIT_DOM_IS_HTML_AREA_ELEMENT(self)); |
598 | g_return_if_fail(value); |
599 | WebCore::HTMLAreaElement* item = WebKit::core(self); |
600 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
601 | item->setHash(convertedValue); |
602 | } |
603 | |
604 | G_GNUC_END_IGNORE_DEPRECATIONS; |
605 | |