From 8810bc01635996fc6afa33a84ffb004aca6095e3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 18 Nov 2012 21:24:29 +0000 Subject: [PATCH] add nodeName implementation --- javascript/jsapi/dom.bnd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/javascript/jsapi/dom.bnd b/javascript/jsapi/dom.bnd index e11e07131..8020e7a8f 100644 --- a/javascript/jsapi/dom.bnd +++ b/javascript/jsapi/dom.bnd @@ -16,6 +16,23 @@ getter nodeType %{ %} + +getter nodeName %{ + dom_exception exc; + dom_string *name; + + exc = dom_node_get_node_name(private->node, &name); + if (exc != DOM_NO_ERR) { + return JS_FALSE; + } + + if (name != NULL) { + jsret = JS_NewStringCopyN(cx, dom_string_data(name), dom_string_length(name)); + dom_string_unref(name); + + } +%} + getter textContent %{ dom_exception exc; dom_string *content;