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 "WebKitDOMHTMLTableCellElement.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 "WebKitDOMEventPrivate.h" |
31 | #include "WebKitDOMEventTarget.h" |
32 | #include "WebKitDOMHTMLTableCellElementPrivate.h" |
33 | #include "WebKitDOMNodePrivate.h" |
34 | #include "WebKitDOMPrivate.h" |
35 | #include "ConvertToUTF8String.h" |
36 | #include <wtf/GetPtr.h> |
37 | #include <wtf/RefPtr.h> |
38 | |
39 | G_GNUC_BEGIN_IGNORE_DEPRECATIONS; |
40 | |
41 | namespace WebKit { |
42 | |
43 | WebKitDOMHTMLTableCellElement* kit(WebCore::HTMLTableCellElement* obj) |
44 | { |
45 | return WEBKIT_DOM_HTML_TABLE_CELL_ELEMENT(kit(static_cast<WebCore::Node*>(obj))); |
46 | } |
47 | |
48 | WebCore::HTMLTableCellElement* core(WebKitDOMHTMLTableCellElement* request) |
49 | { |
50 | return request ? static_cast<WebCore::HTMLTableCellElement*>(WEBKIT_DOM_OBJECT(request)->coreObject) : 0; |
51 | } |
52 | |
53 | WebKitDOMHTMLTableCellElement* wrapHTMLTableCellElement(WebCore::HTMLTableCellElement* coreObject) |
54 | { |
55 | ASSERT(coreObject); |
56 | return WEBKIT_DOM_HTML_TABLE_CELL_ELEMENT(g_object_new(WEBKIT_DOM_TYPE_HTML_TABLE_CELL_ELEMENT, "core-object" , coreObject, nullptr)); |
57 | } |
58 | |
59 | } // namespace WebKit |
60 | |
61 | static gboolean webkit_dom_html_table_cell_element_dispatch_event(WebKitDOMEventTarget* target, WebKitDOMEvent* event, GError** error) |
62 | { |
63 | WebCore::Event* coreEvent = WebKit::core(event); |
64 | if (!coreEvent) |
65 | return false; |
66 | WebCore::HTMLTableCellElement* coreTarget = static_cast<WebCore::HTMLTableCellElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
67 | |
68 | auto result = coreTarget->dispatchEventForBindings(*coreEvent); |
69 | if (result.hasException()) { |
70 | auto description = WebCore::DOMException::description(result.releaseException().code()); |
71 | g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM" ), description.legacyCode, description.name); |
72 | return false; |
73 | } |
74 | return result.releaseReturnValue(); |
75 | } |
76 | |
77 | static gboolean webkit_dom_html_table_cell_element_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
78 | { |
79 | WebCore::HTMLTableCellElement* coreTarget = static_cast<WebCore::HTMLTableCellElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
80 | return WebKit::GObjectEventListener::addEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture); |
81 | } |
82 | |
83 | static gboolean webkit_dom_html_table_cell_element_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GClosure* handler, gboolean useCapture) |
84 | { |
85 | WebCore::HTMLTableCellElement* coreTarget = static_cast<WebCore::HTMLTableCellElement*>(WEBKIT_DOM_OBJECT(target)->coreObject); |
86 | return WebKit::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, useCapture); |
87 | } |
88 | |
89 | static void webkit_dom_html_table_cell_element_dom_event_target_init(WebKitDOMEventTargetIface* iface) |
90 | { |
91 | iface->dispatch_event = webkit_dom_html_table_cell_element_dispatch_event; |
92 | iface->add_event_listener = webkit_dom_html_table_cell_element_add_event_listener; |
93 | iface->remove_event_listener = webkit_dom_html_table_cell_element_remove_event_listener; |
94 | } |
95 | |
96 | G_DEFINE_TYPE_WITH_CODE(WebKitDOMHTMLTableCellElement, webkit_dom_html_table_cell_element, WEBKIT_DOM_TYPE_HTML_ELEMENT, G_IMPLEMENT_INTERFACE(WEBKIT_DOM_TYPE_EVENT_TARGET, webkit_dom_html_table_cell_element_dom_event_target_init)) |
97 | |
98 | enum { |
99 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_0, |
100 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_CELL_INDEX, |
101 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_ALIGN, |
102 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_AXIS, |
103 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_BG_COLOR, |
104 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH, |
105 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH_OFF, |
106 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_COL_SPAN, |
107 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_ROW_SPAN, |
108 | , |
109 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEIGHT, |
110 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_NO_WRAP, |
111 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_V_ALIGN, |
112 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_WIDTH, |
113 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_ABBR, |
114 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_SCOPE, |
115 | }; |
116 | |
117 | static void webkit_dom_html_table_cell_element_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec) |
118 | { |
119 | WebKitDOMHTMLTableCellElement* self = WEBKIT_DOM_HTML_TABLE_CELL_ELEMENT(object); |
120 | |
121 | switch (propertyId) { |
122 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_ALIGN: |
123 | webkit_dom_html_table_cell_element_set_align(self, g_value_get_string(value)); |
124 | break; |
125 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_AXIS: |
126 | webkit_dom_html_table_cell_element_set_axis(self, g_value_get_string(value)); |
127 | break; |
128 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_BG_COLOR: |
129 | webkit_dom_html_table_cell_element_set_bg_color(self, g_value_get_string(value)); |
130 | break; |
131 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH: |
132 | webkit_dom_html_table_cell_element_set_ch(self, g_value_get_string(value)); |
133 | break; |
134 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH_OFF: |
135 | webkit_dom_html_table_cell_element_set_ch_off(self, g_value_get_string(value)); |
136 | break; |
137 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_COL_SPAN: |
138 | webkit_dom_html_table_cell_element_set_col_span(self, g_value_get_long(value)); |
139 | break; |
140 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_ROW_SPAN: |
141 | webkit_dom_html_table_cell_element_set_row_span(self, g_value_get_long(value)); |
142 | break; |
143 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEADERS: |
144 | webkit_dom_html_table_cell_element_set_headers(self, g_value_get_string(value)); |
145 | break; |
146 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEIGHT: |
147 | webkit_dom_html_table_cell_element_set_height(self, g_value_get_string(value)); |
148 | break; |
149 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_NO_WRAP: |
150 | webkit_dom_html_table_cell_element_set_no_wrap(self, g_value_get_boolean(value)); |
151 | break; |
152 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_V_ALIGN: |
153 | webkit_dom_html_table_cell_element_set_v_align(self, g_value_get_string(value)); |
154 | break; |
155 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_WIDTH: |
156 | webkit_dom_html_table_cell_element_set_width(self, g_value_get_string(value)); |
157 | break; |
158 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_ABBR: |
159 | webkit_dom_html_table_cell_element_set_abbr(self, g_value_get_string(value)); |
160 | break; |
161 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_SCOPE: |
162 | webkit_dom_html_table_cell_element_set_scope(self, g_value_get_string(value)); |
163 | break; |
164 | default: |
165 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
166 | break; |
167 | } |
168 | } |
169 | |
170 | static void webkit_dom_html_table_cell_element_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec) |
171 | { |
172 | WebKitDOMHTMLTableCellElement* self = WEBKIT_DOM_HTML_TABLE_CELL_ELEMENT(object); |
173 | |
174 | switch (propertyId) { |
175 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_CELL_INDEX: |
176 | g_value_set_long(value, webkit_dom_html_table_cell_element_get_cell_index(self)); |
177 | break; |
178 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_ALIGN: |
179 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_align(self)); |
180 | break; |
181 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_AXIS: |
182 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_axis(self)); |
183 | break; |
184 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_BG_COLOR: |
185 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_bg_color(self)); |
186 | break; |
187 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH: |
188 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_ch(self)); |
189 | break; |
190 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH_OFF: |
191 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_ch_off(self)); |
192 | break; |
193 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_COL_SPAN: |
194 | g_value_set_long(value, webkit_dom_html_table_cell_element_get_col_span(self)); |
195 | break; |
196 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_ROW_SPAN: |
197 | g_value_set_long(value, webkit_dom_html_table_cell_element_get_row_span(self)); |
198 | break; |
199 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEADERS: |
200 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_headers(self)); |
201 | break; |
202 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEIGHT: |
203 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_height(self)); |
204 | break; |
205 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_NO_WRAP: |
206 | g_value_set_boolean(value, webkit_dom_html_table_cell_element_get_no_wrap(self)); |
207 | break; |
208 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_V_ALIGN: |
209 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_v_align(self)); |
210 | break; |
211 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_WIDTH: |
212 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_width(self)); |
213 | break; |
214 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_ABBR: |
215 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_abbr(self)); |
216 | break; |
217 | case DOM_HTML_TABLE_CELL_ELEMENT_PROP_SCOPE: |
218 | g_value_take_string(value, webkit_dom_html_table_cell_element_get_scope(self)); |
219 | break; |
220 | default: |
221 | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, propertyId, pspec); |
222 | break; |
223 | } |
224 | } |
225 | |
226 | static void webkit_dom_html_table_cell_element_class_init(WebKitDOMHTMLTableCellElementClass* requestClass) |
227 | { |
228 | GObjectClass* gobjectClass = G_OBJECT_CLASS(requestClass); |
229 | gobjectClass->set_property = webkit_dom_html_table_cell_element_set_property; |
230 | gobjectClass->get_property = webkit_dom_html_table_cell_element_get_property; |
231 | |
232 | g_object_class_install_property( |
233 | gobjectClass, |
234 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_CELL_INDEX, |
235 | g_param_spec_long( |
236 | "cell-index" , |
237 | "HTMLTableCellElement:cell-index" , |
238 | "read-only glong HTMLTableCellElement:cell-index" , |
239 | G_MINLONG, G_MAXLONG, 0, |
240 | WEBKIT_PARAM_READABLE)); |
241 | |
242 | g_object_class_install_property( |
243 | gobjectClass, |
244 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_ALIGN, |
245 | g_param_spec_string( |
246 | "align" , |
247 | "HTMLTableCellElement:align" , |
248 | "read-write gchar* HTMLTableCellElement:align" , |
249 | "" , |
250 | WEBKIT_PARAM_READWRITE)); |
251 | |
252 | g_object_class_install_property( |
253 | gobjectClass, |
254 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_AXIS, |
255 | g_param_spec_string( |
256 | "axis" , |
257 | "HTMLTableCellElement:axis" , |
258 | "read-write gchar* HTMLTableCellElement:axis" , |
259 | "" , |
260 | WEBKIT_PARAM_READWRITE)); |
261 | |
262 | g_object_class_install_property( |
263 | gobjectClass, |
264 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_BG_COLOR, |
265 | g_param_spec_string( |
266 | "bg-color" , |
267 | "HTMLTableCellElement:bg-color" , |
268 | "read-write gchar* HTMLTableCellElement:bg-color" , |
269 | "" , |
270 | WEBKIT_PARAM_READWRITE)); |
271 | |
272 | g_object_class_install_property( |
273 | gobjectClass, |
274 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH, |
275 | g_param_spec_string( |
276 | "ch" , |
277 | "HTMLTableCellElement:ch" , |
278 | "read-write gchar* HTMLTableCellElement:ch" , |
279 | "" , |
280 | WEBKIT_PARAM_READWRITE)); |
281 | |
282 | g_object_class_install_property( |
283 | gobjectClass, |
284 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_CH_OFF, |
285 | g_param_spec_string( |
286 | "ch-off" , |
287 | "HTMLTableCellElement:ch-off" , |
288 | "read-write gchar* HTMLTableCellElement:ch-off" , |
289 | "" , |
290 | WEBKIT_PARAM_READWRITE)); |
291 | |
292 | g_object_class_install_property( |
293 | gobjectClass, |
294 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_COL_SPAN, |
295 | g_param_spec_long( |
296 | "col-span" , |
297 | "HTMLTableCellElement:col-span" , |
298 | "read-write glong HTMLTableCellElement:col-span" , |
299 | G_MINLONG, G_MAXLONG, 0, |
300 | WEBKIT_PARAM_READWRITE)); |
301 | |
302 | g_object_class_install_property( |
303 | gobjectClass, |
304 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_ROW_SPAN, |
305 | g_param_spec_long( |
306 | "row-span" , |
307 | "HTMLTableCellElement:row-span" , |
308 | "read-write glong HTMLTableCellElement:row-span" , |
309 | G_MINLONG, G_MAXLONG, 0, |
310 | WEBKIT_PARAM_READWRITE)); |
311 | |
312 | g_object_class_install_property( |
313 | gobjectClass, |
314 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEADERS, |
315 | g_param_spec_string( |
316 | "headers" , |
317 | "HTMLTableCellElement:headers" , |
318 | "read-write gchar* HTMLTableCellElement:headers" , |
319 | "" , |
320 | WEBKIT_PARAM_READWRITE)); |
321 | |
322 | g_object_class_install_property( |
323 | gobjectClass, |
324 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_HEIGHT, |
325 | g_param_spec_string( |
326 | "height" , |
327 | "HTMLTableCellElement:height" , |
328 | "read-write gchar* HTMLTableCellElement:height" , |
329 | "" , |
330 | WEBKIT_PARAM_READWRITE)); |
331 | |
332 | g_object_class_install_property( |
333 | gobjectClass, |
334 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_NO_WRAP, |
335 | g_param_spec_boolean( |
336 | "no-wrap" , |
337 | "HTMLTableCellElement:no-wrap" , |
338 | "read-write gboolean HTMLTableCellElement:no-wrap" , |
339 | FALSE, |
340 | WEBKIT_PARAM_READWRITE)); |
341 | |
342 | g_object_class_install_property( |
343 | gobjectClass, |
344 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_V_ALIGN, |
345 | g_param_spec_string( |
346 | "v-align" , |
347 | "HTMLTableCellElement:v-align" , |
348 | "read-write gchar* HTMLTableCellElement:v-align" , |
349 | "" , |
350 | WEBKIT_PARAM_READWRITE)); |
351 | |
352 | g_object_class_install_property( |
353 | gobjectClass, |
354 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_WIDTH, |
355 | g_param_spec_string( |
356 | "width" , |
357 | "HTMLTableCellElement:width" , |
358 | "read-write gchar* HTMLTableCellElement:width" , |
359 | "" , |
360 | WEBKIT_PARAM_READWRITE)); |
361 | |
362 | g_object_class_install_property( |
363 | gobjectClass, |
364 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_ABBR, |
365 | g_param_spec_string( |
366 | "abbr" , |
367 | "HTMLTableCellElement:abbr" , |
368 | "read-write gchar* HTMLTableCellElement:abbr" , |
369 | "" , |
370 | WEBKIT_PARAM_READWRITE)); |
371 | |
372 | g_object_class_install_property( |
373 | gobjectClass, |
374 | DOM_HTML_TABLE_CELL_ELEMENT_PROP_SCOPE, |
375 | g_param_spec_string( |
376 | "scope" , |
377 | "HTMLTableCellElement:scope" , |
378 | "read-write gchar* HTMLTableCellElement:scope" , |
379 | "" , |
380 | WEBKIT_PARAM_READWRITE)); |
381 | |
382 | } |
383 | |
384 | static void webkit_dom_html_table_cell_element_init(WebKitDOMHTMLTableCellElement* request) |
385 | { |
386 | UNUSED_PARAM(request); |
387 | } |
388 | |
389 | glong webkit_dom_html_table_cell_element_get_cell_index(WebKitDOMHTMLTableCellElement* self) |
390 | { |
391 | WebCore::JSMainThreadNullState state; |
392 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
393 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
394 | glong result = item->cellIndex(); |
395 | return result; |
396 | } |
397 | |
398 | gchar* webkit_dom_html_table_cell_element_get_align(WebKitDOMHTMLTableCellElement* self) |
399 | { |
400 | WebCore::JSMainThreadNullState state; |
401 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
402 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
403 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::alignAttr)); |
404 | return result; |
405 | } |
406 | |
407 | void webkit_dom_html_table_cell_element_set_align(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
408 | { |
409 | WebCore::JSMainThreadNullState state; |
410 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
411 | g_return_if_fail(value); |
412 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
413 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
414 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, convertedValue); |
415 | } |
416 | |
417 | gchar* webkit_dom_html_table_cell_element_get_axis(WebKitDOMHTMLTableCellElement* self) |
418 | { |
419 | WebCore::JSMainThreadNullState state; |
420 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
421 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
422 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::axisAttr)); |
423 | return result; |
424 | } |
425 | |
426 | void webkit_dom_html_table_cell_element_set_axis(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
427 | { |
428 | WebCore::JSMainThreadNullState state; |
429 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
430 | g_return_if_fail(value); |
431 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
432 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
433 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::axisAttr, convertedValue); |
434 | } |
435 | |
436 | gchar* webkit_dom_html_table_cell_element_get_bg_color(WebKitDOMHTMLTableCellElement* self) |
437 | { |
438 | WebCore::JSMainThreadNullState state; |
439 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
440 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
441 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::bgcolorAttr)); |
442 | return result; |
443 | } |
444 | |
445 | void webkit_dom_html_table_cell_element_set_bg_color(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
446 | { |
447 | WebCore::JSMainThreadNullState state; |
448 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
449 | g_return_if_fail(value); |
450 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
451 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
452 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::bgcolorAttr, convertedValue); |
453 | } |
454 | |
455 | gchar* webkit_dom_html_table_cell_element_get_ch(WebKitDOMHTMLTableCellElement* self) |
456 | { |
457 | WebCore::JSMainThreadNullState state; |
458 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
459 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
460 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::charAttr)); |
461 | return result; |
462 | } |
463 | |
464 | void webkit_dom_html_table_cell_element_set_ch(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
465 | { |
466 | WebCore::JSMainThreadNullState state; |
467 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
468 | g_return_if_fail(value); |
469 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
470 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
471 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::charAttr, convertedValue); |
472 | } |
473 | |
474 | gchar* webkit_dom_html_table_cell_element_get_ch_off(WebKitDOMHTMLTableCellElement* self) |
475 | { |
476 | WebCore::JSMainThreadNullState state; |
477 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
478 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
479 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::charoffAttr)); |
480 | return result; |
481 | } |
482 | |
483 | void webkit_dom_html_table_cell_element_set_ch_off(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
484 | { |
485 | WebCore::JSMainThreadNullState state; |
486 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
487 | g_return_if_fail(value); |
488 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
489 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
490 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::charoffAttr, convertedValue); |
491 | } |
492 | |
493 | glong webkit_dom_html_table_cell_element_get_col_span(WebKitDOMHTMLTableCellElement* self) |
494 | { |
495 | WebCore::JSMainThreadNullState state; |
496 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
497 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
498 | glong result = item->colSpan(); |
499 | return result; |
500 | } |
501 | |
502 | void webkit_dom_html_table_cell_element_set_col_span(WebKitDOMHTMLTableCellElement* self, glong value) |
503 | { |
504 | WebCore::JSMainThreadNullState state; |
505 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
506 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
507 | item->setColSpan(value); |
508 | } |
509 | |
510 | glong webkit_dom_html_table_cell_element_get_row_span(WebKitDOMHTMLTableCellElement* self) |
511 | { |
512 | WebCore::JSMainThreadNullState state; |
513 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
514 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
515 | glong result = item->rowSpanForBindings(); |
516 | return result; |
517 | } |
518 | |
519 | void webkit_dom_html_table_cell_element_set_row_span(WebKitDOMHTMLTableCellElement* self, glong value) |
520 | { |
521 | WebCore::JSMainThreadNullState state; |
522 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
523 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
524 | item->setRowSpanForBindings(value); |
525 | } |
526 | |
527 | gchar* (WebKitDOMHTMLTableCellElement* self) |
528 | { |
529 | WebCore::JSMainThreadNullState state; |
530 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
531 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
532 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::headersAttr)); |
533 | return result; |
534 | } |
535 | |
536 | void (WebKitDOMHTMLTableCellElement* self, const gchar* value) |
537 | { |
538 | WebCore::JSMainThreadNullState state; |
539 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
540 | g_return_if_fail(value); |
541 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
542 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
543 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::headersAttr, convertedValue); |
544 | } |
545 | |
546 | gchar* webkit_dom_html_table_cell_element_get_height(WebKitDOMHTMLTableCellElement* self) |
547 | { |
548 | WebCore::JSMainThreadNullState state; |
549 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
550 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
551 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::heightAttr)); |
552 | return result; |
553 | } |
554 | |
555 | void webkit_dom_html_table_cell_element_set_height(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
556 | { |
557 | WebCore::JSMainThreadNullState state; |
558 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
559 | g_return_if_fail(value); |
560 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
561 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
562 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, convertedValue); |
563 | } |
564 | |
565 | gboolean webkit_dom_html_table_cell_element_get_no_wrap(WebKitDOMHTMLTableCellElement* self) |
566 | { |
567 | WebCore::JSMainThreadNullState state; |
568 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), FALSE); |
569 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
570 | gboolean result = item->hasAttributeWithoutSynchronization(WebCore::HTMLNames::nowrapAttr); |
571 | return result; |
572 | } |
573 | |
574 | void webkit_dom_html_table_cell_element_set_no_wrap(WebKitDOMHTMLTableCellElement* self, gboolean value) |
575 | { |
576 | WebCore::JSMainThreadNullState state; |
577 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
578 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
579 | item->setBooleanAttribute(WebCore::HTMLNames::nowrapAttr, value); |
580 | } |
581 | |
582 | gchar* webkit_dom_html_table_cell_element_get_v_align(WebKitDOMHTMLTableCellElement* self) |
583 | { |
584 | WebCore::JSMainThreadNullState state; |
585 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
586 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
587 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::valignAttr)); |
588 | return result; |
589 | } |
590 | |
591 | void webkit_dom_html_table_cell_element_set_v_align(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
592 | { |
593 | WebCore::JSMainThreadNullState state; |
594 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
595 | g_return_if_fail(value); |
596 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
597 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
598 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::valignAttr, convertedValue); |
599 | } |
600 | |
601 | gchar* webkit_dom_html_table_cell_element_get_width(WebKitDOMHTMLTableCellElement* self) |
602 | { |
603 | WebCore::JSMainThreadNullState state; |
604 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
605 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
606 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::widthAttr)); |
607 | return result; |
608 | } |
609 | |
610 | void webkit_dom_html_table_cell_element_set_width(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
611 | { |
612 | WebCore::JSMainThreadNullState state; |
613 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
614 | g_return_if_fail(value); |
615 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
616 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
617 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, convertedValue); |
618 | } |
619 | |
620 | gchar* webkit_dom_html_table_cell_element_get_abbr(WebKitDOMHTMLTableCellElement* self) |
621 | { |
622 | WebCore::JSMainThreadNullState state; |
623 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
624 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
625 | gchar* result = convertToUTF8String(item->attributeWithoutSynchronization(WebCore::HTMLNames::abbrAttr)); |
626 | return result; |
627 | } |
628 | |
629 | void webkit_dom_html_table_cell_element_set_abbr(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
630 | { |
631 | WebCore::JSMainThreadNullState state; |
632 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
633 | g_return_if_fail(value); |
634 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
635 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
636 | item->setAttributeWithoutSynchronization(WebCore::HTMLNames::abbrAttr, convertedValue); |
637 | } |
638 | |
639 | gchar* webkit_dom_html_table_cell_element_get_scope(WebKitDOMHTMLTableCellElement* self) |
640 | { |
641 | WebCore::JSMainThreadNullState state; |
642 | g_return_val_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self), 0); |
643 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
644 | gchar* result = convertToUTF8String(item->scope()); |
645 | return result; |
646 | } |
647 | |
648 | void webkit_dom_html_table_cell_element_set_scope(WebKitDOMHTMLTableCellElement* self, const gchar* value) |
649 | { |
650 | WebCore::JSMainThreadNullState state; |
651 | g_return_if_fail(WEBKIT_DOM_IS_HTML_TABLE_CELL_ELEMENT(self)); |
652 | g_return_if_fail(value); |
653 | WebCore::HTMLTableCellElement* item = WebKit::core(self); |
654 | WTF::String convertedValue = WTF::String::fromUTF8(value); |
655 | item->setScope(convertedValue); |
656 | } |
657 | |
658 | G_GNUC_END_IGNORE_DEPRECATIONS; |
659 | |