diff options
Diffstat (limited to 'javascript/jsapi/htmlelement.bnd')
-rw-r--r-- | javascript/jsapi/htmlelement.bnd | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/javascript/jsapi/htmlelement.bnd b/javascript/jsapi/htmlelement.bnd index f0032fa1a..5af2d5b25 100644 --- a/javascript/jsapi/htmlelement.bnd +++ b/javascript/jsapi/htmlelement.bnd @@ -175,6 +175,44 @@ operation setAttribute %{ %} /* + * + * Dom 4 says this should return a htmlcollection, libdom currently + * returns DOM 3 spec of a nodelist + */ +/* HTMLCollection Element::getElementsByTagName(DOMString localName); */ +operation getElementsByTagName %{ + dom_string *localName_dom; + /* dom_html_collection *collection;*/ + dom_nodelist *nodelist; + dom_exception exc; + + exc = dom_string_create((uint8_t *)localName, localName_len, &localName_dom); + if (exc != DOM_NO_ERR) { + return JS_FALSE; + } + + exc = dom_element_get_elements_by_tag_name(private->node, localName_dom, /*&collection*/&nodelist); + dom_string_unref(localName_dom); + if (exc != DOM_NO_ERR) { + return JS_FALSE; + } + + if (/*collection*/nodelist != NULL) { + /*jsret = jsapi_new_HTMLCollection(cx, + NULL, + NULL, + collection, + private->htmlc);*/ + jsret = jsapi_new_NodeList(cx, + NULL, + NULL, + nodelist, + private->htmlc); + } + +%} + +/* * DOM 3 has these as the element traversal extension * * http://dev.w3.org/2006/webapi/ElementTraversal/publish/ElementTraversal.html |