add Node interface binding just to get the prototype

This commit is contained in:
Vincent Sanders 2012-11-14 02:11:01 +00:00
parent 9acba6cbcc
commit 2bea506f83
4 changed files with 45 additions and 0 deletions

View File

@ -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

View 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
View 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 */
}

View File

@ -135,6 +135,11 @@ api init %{
return NULL;
}
user_proto = jsapi_InitClass_Node(cx, prototype);
if (user_proto == NULL) {
return NULL;
}
%}
api new %{