diff --git a/Docs/UnimplementedJavascript.txt b/Docs/UnimplementedJavascript.txt index ccc924726..7af3f16ea 100644 --- a/Docs/UnimplementedJavascript.txt +++ b/Docs/UnimplementedJavascript.txt @@ -480,7 +480,6 @@ method Element::queryAll();\n method Element::querySelector();\n method Element::querySelectorAll();\n method Element::remove();\n -method Element::removeAttribute();\n method Element::removeAttributeNode();\n method Element::removeAttributeNS();\n method Element::replaceWith();\n 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;