summaryrefslogtreecommitdiff
path: root/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'javascript')
-rw-r--r--javascript/jsapi/dom.bnd7
-rw-r--r--javascript/jsapi/text.bnd44
-rw-r--r--javascript/jsapi/window.bnd5
3 files changed, 56 insertions, 0 deletions
diff --git a/javascript/jsapi/dom.bnd b/javascript/jsapi/dom.bnd
index cd252fc27..c2f9e787e 100644
--- a/javascript/jsapi/dom.bnd
+++ b/javascript/jsapi/dom.bnd
@@ -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 %{
+%}
diff --git a/javascript/jsapi/text.bnd b/javascript/jsapi/text.bnd
new file mode 100644
index 000000000..d440e4a9e
--- /dev/null
+++ b/javascript/jsapi/text.bnd
@@ -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);
+ }
+%}
diff --git a/javascript/jsapi/window.bnd b/javascript/jsapi/window.bnd
index 865cbf3d4..5a7de530f 100644
--- a/javascript/jsapi/window.bnd
+++ b/javascript/jsapi/window.bnd
@@ -130,6 +130,11 @@ api init %{
return NULL;
}
+ user_proto = jsapi_InitClass_Text(cx, prototype);
+ if (user_proto == NULL) {
+ return NULL;
+ }
+
%}
api new %{