Add support for Element::removeAttribute.

This commit is contained in:
Michael Drake 2015-10-29 16:51:57 +00:00
parent 218839d05a
commit 0fabb20cc5
2 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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;