summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-09-22 22:45:35 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-09-22 22:45:35 +0000
commitd92e7f8b5d95e832101ab8a5b58630caec1ebd57 (patch)
treefc1fae1a57affc723801efb7684da83e867096ce /src
parent6b471d573f09a51867c4c415f6b8f9b16d937ffb (diff)
downloadlibdom-d92e7f8b5d95e832101ab8a5b58630caec1ebd57.tar.gz
libdom-d92e7f8b5d95e832101ab8a5b58630caec1ebd57.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')
-rw-r--r--src/core/document.c27
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);
}
/**