diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-10-18 11:06:41 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-10-18 11:06:41 +0100 |
commit | 6d0d964cac44ede2b6defa4d9330f51d22b30689 (patch) | |
tree | e8b40d8d8d1dda4e038725b497b384ba1c902638 /javascript/duktape/Document.bnd | |
parent | eb17f4ab37cd47a12f97f0ab37b92d5297bd6743 (diff) | |
download | netsurf-6d0d964cac44ede2b6defa4d9330f51d22b30689.tar.gz netsurf-6d0d964cac44ede2b6defa4d9330f51d22b30689.tar.bz2 |
Implement Document::documentElement binding
Diffstat (limited to 'javascript/duktape/Document.bnd')
-rw-r--r-- | javascript/duktape/Document.bnd | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/javascript/duktape/Document.bnd b/javascript/duktape/Document.bnd index cffff88a3..d02e53f9c 100644 --- a/javascript/duktape/Document.bnd +++ b/javascript/duktape/Document.bnd @@ -245,6 +245,28 @@ method Document::getElementById() return 0; %} +getter Document::documentElement() +%{ + dom_exception exc; + dom_element *element; + + exc = dom_document_get_document_element(((node_private_t *)priv)->node, + &element); + if (exc != DOM_NO_ERR) { + return 0; + } + + if (element == NULL) { + return 0; + } + + dukky_push_node(ctx, (dom_node *)element); + dom_node_unref(element); + + return 1; + +%} + method Document::getElementsByTagName() %{ dom_nodelist *nodes; |