mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-23 12:36:51 +03:00
add Node interface binding just to get the prototype
This commit is contained in:
parent
9acba6cbcc
commit
2bea506f83
@ -20,6 +20,7 @@ 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
|
||||
JSAPI_BINDING_node := javascript/jsapi/node.bnd
|
||||
|
||||
# 1: input file
|
||||
# 2: output file
|
||||
|
@ -143,4 +143,9 @@ JSObject *jsapi_new_Text(JSContext *cx,
|
||||
dom_text *node,
|
||||
struct html_content *htmlc);
|
||||
|
||||
JSObject *jsapi_InitClass_Node(JSContext *cx, JSObject *parent);
|
||||
JSObject *jsapi_new_Node(JSContext *cx,
|
||||
JSObject *prototype,
|
||||
JSObject *parent);
|
||||
|
||||
#endif
|
||||
|
34
javascript/jsapi/node.bnd
Normal file
34
javascript/jsapi/node.bnd
Normal file
@ -0,0 +1,34 @@
|
||||
/* Binding to generate Node 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
|
||||
*/
|
||||
|
||||
webidlfile "dom.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 node {
|
||||
type js_libdom; /* the binding type */
|
||||
|
||||
interface Node; /* Web IDL interface to generate */
|
||||
}
|
@ -135,6 +135,11 @@ api init %{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
user_proto = jsapi_InitClass_Node(cx, prototype);
|
||||
if (user_proto == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
api new %{
|
||||
|
Loading…
Reference in New Issue
Block a user