diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2007-09-22 22:45:35 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2007-09-22 22:45:35 +0000 |
commit | b41f9b430878ea33ba8da7b30bfb6a81a4dd0317 (patch) | |
tree | fc1fae1a57affc723801efb7684da83e867096ce /src/core/document.c | |
parent | b3af96982bcf05f4932a5292e9d9ff4ac487bb69 (diff) | |
download | libdom-b41f9b430878ea33ba8da7b30bfb6a81a4dd0317.tar.gz libdom-b41f9b430878ea33ba8da7b30bfb6a81a4dd0317.tar.bz2 |
Implement dom_document_get_implementation()
Implement dom_document_get_elements_by_tag_name()
Implement dom_document_get_elements_by_tag_name_ns()
svn path=/trunk/dom/; revision=3572
Diffstat (limited to 'src/core/document.c')
-rw-r--r-- | src/core/document.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/core/document.c b/src/core/document.c index d768946..aedf96c 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -266,14 +266,20 @@ dom_exception dom_document_get_doctype(struct dom_document *doc, * \param doc The document to retrieve the implementation from * \param result Pointer to location to receive result * \return DOM_NO_ERR. + * + * The returned implementation will have its reference count increased. + * It is the responsibility of the caller to unref the implementation once + * it has finished with it. */ dom_exception dom_document_get_implementation(struct dom_document *doc, struct dom_implementation **result) { - UNUSED(doc); - UNUSED(result); + if (doc->impl != NULL) + dom_implementation_ref(doc->impl); - return DOM_NOT_SUPPORTED_ERR; + *result = doc->impl; + + return DOM_NO_ERR; } /** @@ -483,11 +489,8 @@ dom_exception dom_document_create_entity_reference(struct dom_document *doc, dom_exception dom_document_get_elements_by_tag_name(struct dom_document *doc, struct dom_string *tagname, struct dom_nodelist **result) { - UNUSED(doc); - UNUSED(tagname); - UNUSED(result); - - return DOM_NOT_SUPPORTED_ERR; + return dom_document_get_nodelist(doc, (struct dom_node *) doc, + tagname, NULL, NULL, result); } /** @@ -613,12 +616,8 @@ dom_exception dom_document_get_elements_by_tag_name_ns( struct dom_document *doc, struct dom_string *namespace, struct dom_string *localname, struct dom_nodelist **result) { - UNUSED(doc); - UNUSED(namespace); - UNUSED(localname); - UNUSED(result); - - return DOM_NOT_SUPPORTED_ERR; + return dom_document_get_nodelist(doc, (struct dom_node *) doc, + NULL, namespace, localname, result); } /** |