summaryrefslogtreecommitdiff
path: root/javascript/jsapi/htmldocument.bnd
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/jsapi/htmldocument.bnd')
-rw-r--r--javascript/jsapi/htmldocument.bnd24
1 files changed, 24 insertions, 0 deletions
diff --git a/javascript/jsapi/htmldocument.bnd b/javascript/jsapi/htmldocument.bnd
index 6205ce01d..cde218450 100644
--- a/javascript/jsapi/htmldocument.bnd
+++ b/javascript/jsapi/htmldocument.bnd
@@ -198,3 +198,27 @@ operation createTextNode %{
JSLOG("returning jsobject %p",jsret);
%}
+
+/* in dom Document */
+operation createElement %{
+ dom_string *localName_dom;
+ dom_exception exc;
+ dom_element *element;
+
+ JSLOG("Creating text node for string \"%s\"", localName);
+ exc = dom_string_create((unsigned char*)localName, localName_len, &localName_dom);
+ if (exc != DOM_NO_ERR) {
+ return JS_FALSE;
+ }
+
+ exc = dom_document_create_element(private->node, localName_dom, &element);
+ dom_string_unref(localName_dom);
+ if (exc != DOM_NO_ERR) {
+ return JS_FALSE;
+ }
+
+ jsret = jsapi_new_HTMLElement(cx, NULL, NULL, element, private->htmlc);
+
+ JSLOG("returning jsobject %p",jsret);
+
+%}