summaryrefslogtreecommitdiff
path: root/src/core/document.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-12-05 23:52:56 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-12-05 23:52:56 +0000
commitac42344d05ec326f0063133498ec1c040e924db2 (patch)
tree4041bc41d72721a94dc573e5be3cb0f80988e004 /src/core/document.c
parentc9c2a632f38b736d6879caf00aa477ecf2e22dfb (diff)
downloadlibdom-ac42344d05ec326f0063133498ec1c040e924db2.tar.gz
libdom-ac42344d05ec326f0063133498ec1c040e924db2.tar.bz2
Remove bootstrap infrastructure, and just make dom_implementation a stub.
We only support a single implementation, so all the registry and implementation list stuff is totally unnecesary and overcomplex svn path=/trunk/dom/; revision=11017
Diffstat (limited to 'src/core/document.c')
-rw-r--r--src/core/document.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/core/document.c b/src/core/document.c
index ad25bd7..20ad789 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -11,7 +11,6 @@
#include <libwapcaplet/libwapcaplet.h>
#include <dom/functypes.h>
-#include <dom/bootstrap/implpriv.h>
#include <dom/core/attr.h>
#include <dom/core/element.h>
#include <dom/core/document.h>
@@ -71,7 +70,6 @@ static dom_exception dom_document_dup_node(dom_document *doc,
/**
* Create a Document
*
- * \param impl The DOM implementation owning the document
* \param alloc Memory (de)allocation function
* \param pw Pointer to client-specific private data
* \param doc Pointer to location to receive created document
@@ -83,8 +81,7 @@ static dom_exception dom_document_dup_node(dom_document *doc,
*
* The returned document will already be referenced.
*/
-dom_exception _dom_document_create(struct dom_implementation *impl,
- dom_alloc alloc, void *pw,
+dom_exception _dom_document_create(dom_alloc alloc, void *pw,
dom_events_default_action_fetcher daf,
struct dom_document **doc)
{
@@ -105,7 +102,7 @@ dom_exception _dom_document_create(struct dom_implementation *impl,
* reaches zero. Documents own themselves (this simplifies the
* rest of the code, as it doesn't need to special case Documents)
*/
- err = _dom_document_initialise(d, impl, alloc, pw, daf);
+ err = _dom_document_initialise(d, alloc, pw, daf);
if (err != DOM_NO_ERR) {
/* Clean up document */
alloc(d, 0, pw);
@@ -119,23 +116,19 @@ dom_exception _dom_document_create(struct dom_implementation *impl,
/* Initialise the document */
dom_exception _dom_document_initialise(struct dom_document *doc,
- struct dom_implementation *impl, dom_alloc alloc, void *pw,
+ dom_alloc alloc, void *pw,
dom_events_default_action_fetcher daf)
{
- assert(alloc != NULL);
- assert(impl != NULL);
-
dom_exception err;
lwc_string *name;
lwc_error lerr;
-
+
+ assert(alloc != NULL);
+
lerr = lwc_intern_string("#document", SLEN("#document"), &name);
if (lerr != lwc_error_ok)
return _dom_exception_from_lwc_error(lerr);
- dom_implementation_ref(impl);
- doc->impl = impl;
-
doc->nodelists = NULL;
/* Set up document allocation context - must be first */
@@ -173,9 +166,6 @@ bool _dom_document_finalise(struct dom_document *doc)
/* Ok, the document tree is empty, as is the list of nodes pending
* deletion. Therefore, it is safe to destroy the document. */
- if (doc->impl != NULL)
- dom_implementation_unref(doc->impl);
- doc->impl = NULL;
/* This is paranoia -- if there are any remaining nodelists,
* then the document's reference count will be
@@ -240,12 +230,11 @@ dom_exception _dom_document_get_doctype(struct dom_document *doc,
* it has finished with it.
*/
dom_exception _dom_document_get_implementation(struct dom_document *doc,
- struct dom_implementation **result)
+ dom_implementation **result)
{
- if (doc->impl != NULL)
- dom_implementation_ref(doc->impl);
+ UNUSED(doc);
- *result = doc->impl;
+ *result = (dom_implementation *) "libdom";
return DOM_NO_ERR;
}