mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-17 09:42:38 +03:00
Add some HTML Element specialisations for HR and BR
These specialisations make use of the new nsgenbind feature of generated property accessors.
This commit is contained in:
parent
6fd2c320f2
commit
b9a23939b2
@ -1024,16 +1024,8 @@ getter HTMLFrameSetElement::rows();\n
|
||||
setter HTMLFrameSetElement::rows();\n
|
||||
getter HTMLHeadingElement::align();\n
|
||||
setter HTMLHeadingElement::align();\n
|
||||
getter HTMLHRElement::align();\n
|
||||
setter HTMLHRElement::align();\n
|
||||
getter HTMLHRElement::color();\n
|
||||
setter HTMLHRElement::color();\n
|
||||
getter HTMLHRElement::noShade();\n
|
||||
setter HTMLHRElement::noShade();\n
|
||||
getter HTMLHRElement::size();\n
|
||||
setter HTMLHRElement::size();\n
|
||||
getter HTMLHRElement::width();\n
|
||||
setter HTMLHRElement::width();\n
|
||||
getter HTMLHtmlElement::version();\n
|
||||
setter HTMLHtmlElement::version();\n
|
||||
getter HTMLIFrameElement::align();\n
|
||||
|
@ -10,41 +10,5 @@
|
||||
|
||||
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;
|
||||
%}
|
||||
getter HTMLBRElement::clear();
|
||||
setter HTMLBRElement::clear();
|
||||
|
24
javascript/duktape/HTMLHRElement.bnd
Normal file
24
javascript/duktape/HTMLHRElement.bnd
Normal file
@ -0,0 +1,24 @@
|
||||
/* HTML hr 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 HTMLHRElement(struct dom_html_element *html_hr_element::html_element);
|
||||
|
||||
getter HTMLHRElement::noShade();
|
||||
setter HTMLHRElement::noShade();
|
||||
|
||||
getter HTMLHRElement::align();
|
||||
setter HTMLHRElement::align();
|
||||
|
||||
getter HTMLHRElement::size();
|
||||
setter HTMLHRElement::size();
|
||||
|
||||
getter HTMLHRElement::width();
|
||||
setter HTMLHRElement::width();
|
||||
|
@ -62,6 +62,7 @@ struct dom_html_br_element;
|
||||
#include "Location.bnd"
|
||||
#include "Navigator.bnd"
|
||||
#include "HTMLBRElement.bnd"
|
||||
#include "HTMLHRElement.bnd"
|
||||
|
||||
/* specialisations of html_element */
|
||||
init HTMLUnknownElement(struct dom_html_element *html_unknown_element::html_element);
|
||||
@ -122,7 +123,6 @@ init HTMLUListElement(struct dom_html_element *html_u_list_element::html_element
|
||||
init HTMLOListElement(struct dom_html_element *html_o_list_element::html_element);
|
||||
init HTMLQuoteElement(struct dom_html_element *html_quote_element::html_element);
|
||||
init HTMLPreElement(struct dom_html_element *html_pre_element::html_element);
|
||||
init HTMLHRElement(struct dom_html_element *html_hr_element::html_element);
|
||||
init HTMLParagraphElement(struct dom_html_element *html_paragraph_element::html_element);
|
||||
init HTMLHeadingElement(struct dom_html_element *html_heading_element::html_element);
|
||||
init HTMLBodyElement(struct dom_html_element *html_body_element::html_element);
|
||||
|
Loading…
Reference in New Issue
Block a user