mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-27 14:29:42 +03:00
add Text interface
This commit is contained in:
parent
43fb761f45
commit
ca24b238ed
@ -19,6 +19,7 @@ JSAPI_BINDING_console := javascript/jsapi/console.bnd
|
||||
JSAPI_BINDING_location := javascript/jsapi/location.bnd
|
||||
JSAPI_BINDING_htmlcollection := javascript/jsapi/htmlcollection.bnd
|
||||
JSAPI_BINDING_nodelist := javascript/jsapi/nodelist.bnd
|
||||
JSAPI_BINDING_text := javascript/jsapi/text.bnd
|
||||
|
||||
# 1: input file
|
||||
# 2: output file
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
webidlfile "dom.idl";
|
||||
|
||||
/* interface Node members */
|
||||
|
||||
|
||||
getter textContent %{
|
||||
dom_exception exc;
|
||||
@ -21,3 +23,8 @@ getter textContent %{
|
||||
|
||||
|
||||
|
||||
operation appendChild %{
|
||||
%}
|
||||
|
||||
operation createTextNode %{
|
||||
%}
|
||||
|
44
javascript/jsapi/text.bnd
Normal file
44
javascript/jsapi/text.bnd
Normal file
@ -0,0 +1,44 @@
|
||||
/* Binding to generate Text interface
|
||||
*
|
||||
* Copyright 2012 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
|
||||
*/
|
||||
|
||||
#include "dom.bnd"
|
||||
|
||||
webidlfile "html.idl";
|
||||
|
||||
hdrcomment "Copyright 2012 Vincent Sanders <vince@netsurf-browser.org>";
|
||||
hdrcomment "This file is part of NetSurf, http://www.netsurf-browser.org/";
|
||||
hdrcomment "Released under the terms of the MIT License,";
|
||||
hdrcomment " http://www.opensource.org/licenses/mit-license";
|
||||
|
||||
preamble %{
|
||||
|
||||
#include <dom/dom.h>
|
||||
|
||||
#include "utils/config.h"
|
||||
#include "utils/log.h"
|
||||
|
||||
#include "javascript/jsapi.h"
|
||||
#include "javascript/jsapi/binding.h"
|
||||
|
||||
%}
|
||||
|
||||
binding text {
|
||||
type js_libdom; /* the binding type */
|
||||
|
||||
interface Text; /* Web IDL interface to generate */
|
||||
|
||||
private "dom_node *" node;
|
||||
}
|
||||
|
||||
api finalise %{
|
||||
if (private != NULL) {
|
||||
dom_node_unref(private->node);
|
||||
}
|
||||
%}
|
@ -130,6 +130,11 @@ api init %{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
user_proto = jsapi_InitClass_Text(cx, prototype);
|
||||
if (user_proto == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
api new %{
|
||||
|
Loading…
Reference in New Issue
Block a user