From 0fabb20cc59ee16441e037867675093200f4b378 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 29 Oct 2015 16:51:57 +0000 Subject: Add support for Element::removeAttribute. --- javascript/duktape/Element.bnd | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'javascript/duktape/Element.bnd') diff --git a/javascript/duktape/Element.bnd b/javascript/duktape/Element.bnd index 04b7b09bc..231c7affb 100644 --- a/javascript/duktape/Element.bnd +++ b/javascript/duktape/Element.bnd @@ -248,6 +248,23 @@ setter Element::id () return 0; %} + +method Element::removeAttribute() +%{ + dom_string *attr = NULL; + dom_exception exc; + duk_size_t slen; + const char *s = duk_safe_to_lstring(ctx, 0, &slen); + + exc = dom_string_create((const uint8_t *)s, slen, &attr); + if (exc != DOM_NO_ERR) return 0; + + exc = dom_element_remove_attribute(priv->parent.node, attr); + dom_string_unref(attr); + if (exc != DOM_NO_ERR) return 0; + return 0; +%} + method Element::setAttribute() %{ dom_exception exc; -- cgit v1.2.3