blob: 25e5184ba8b28cb52c00df2ff37b56c5b8f5e218 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
/* HTML br element binding using duktape and libdom
*
* Copyright 2015 Vincent Sanders <vince@netsurf-browser.org>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
* Released under the terms of the MIT License,
* http://www.opensource.org/licenses/mit-license
*/
init HTMLBRElement(struct dom_html_element *html_br_element::html_element);
getter HTMLBRElement::clear()
%{
dom_exception exc;
dom_string *str;
exc = dom_html_br_element_get_clear(((node_private_t*)priv)->node, &str);
if (exc != DOM_NO_ERR) {
return 0;
}
duk_push_lstring(ctx, dom_string_data(str), dom_string_length(str));
dom_string_unref(str);
return 1;
%}
setter HTMLBRElement::clear()
%{
dom_exception exc;
dom_string *content;
duk_size_t slen;
const char *s;
s = duk_safe_to_lstring(ctx, 0, &slen);
exc = dom_string_create((const uint8_t *)s, slen, &content);
if (exc != DOM_NO_ERR) {
return 0;
}
exc = dom_html_br_element_set_clear(((node_private_t*)priv)->node, content);
dom_string_unref(content);
if (exc != DOM_NO_ERR) {
return 0;
}
return 0;
%}
|