From fbb008b9200a0e0326380366f5d0ffdbc10e4082 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 17 Sep 2007 00:10:56 +0000 Subject: Make Document nodes own themselves (removes need for special case for Documents) Fixup dom_node_destroy appropriately. Implement dom_node_{set,get}_user_data. svn path=/trunk/dom/; revision=3542 --- src/core/document.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/document.c') diff --git a/src/core/document.c b/src/core/document.c index d238558..de57f72 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -140,8 +140,10 @@ dom_exception dom_document_create(struct dom_implementation *impl, /* Initialise base class -- the Document has no parent, so * destruction will be attempted as soon as its reference count - * reaches zero. */ - err = dom_node_initialise(&d->base, NULL, DOM_DOCUMENT_NODE, + * reaches zero. Documents own themselves (this simplifies the + * rest of the code, as it doesn't need to special case Documents) + */ + err = dom_node_initialise(&d->base, d, DOM_DOCUMENT_NODE, NULL, NULL); if (err != DOM_NO_ERR) { /* Clean up interned strings */ -- cgit v1.2.3