summaryrefslogtreecommitdiff
path: root/src/core/document.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2007-07-28 14:34:59 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2007-07-28 14:34:59 +0000
commit7cbcc882de7d5747e2342f0829bbcc9f2bcca60f (patch)
treed3fe522992dec910758c2b86d0d02ec9c2d005a9 /src/core/document.c
parent6d0ecccfcf47341393d66e2379ce82cb8350a20f (diff)
downloadlibdom-7cbcc882de7d5747e2342f0829bbcc9f2bcca60f.tar.gz
libdom-7cbcc882de7d5747e2342f0829bbcc9f2bcca60f.tar.bz2
Sort out somewhat messy object construction.
We now have explicit types for all classes (rather than using the parent class for those which inherit but add no extra data content). svn path=/trunk/dom/; revision=3465
Diffstat (limited to 'src/core/document.c')
-rw-r--r--src/core/document.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/core/document.c b/src/core/document.c
index b5a712e..cc38c3e 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -10,12 +10,17 @@
#include <dom/core/document.h>
#include "core/attr.h"
+#include "core/cdatasection.h"
#include "core/characterdata.h"
+#include "core/comment.h"
#include "core/document.h"
+#include "core/doc_fragment.h"
#include "core/element.h"
+#include "core/entity_ref.h"
#include "core/namednodemap.h"
#include "core/node.h"
#include "core/nodelist.h"
+#include "core/pi.h"
#include "core/text.h"
#include "utils/utils.h"
@@ -161,9 +166,9 @@ dom_exception dom_document_create_element(struct dom_document *doc,
* finished with it.
*/
dom_exception dom_document_create_document_fragment(struct dom_document *doc,
- struct dom_node **result)
+ struct dom_document_fragment **result)
{
- return dom_node_create(doc, DOM_DOCUMENT_FRAGMENT_NODE,
+ return dom_document_fragment_create(doc,
doc->nodenames[DOM_DOCUMENT_FRAGMENT_NODE],
NULL, result);
}
@@ -183,8 +188,8 @@ dom_exception dom_document_create_document_fragment(struct dom_document *doc,
dom_exception dom_document_create_text_node(struct dom_document *doc,
struct dom_string *data, struct dom_text **result)
{
- return dom_text_create(doc, DOM_TEXT_NODE,
- doc->nodenames[DOM_TEXT_NODE], data, result);
+ return dom_text_create(doc, doc->nodenames[DOM_TEXT_NODE],
+ data, result);
}
/**
@@ -200,10 +205,10 @@ dom_exception dom_document_create_text_node(struct dom_document *doc,
* finished with it.
*/
dom_exception dom_document_create_comment(struct dom_document *doc,
- struct dom_string *data, struct dom_characterdata **result)
+ struct dom_string *data, struct dom_comment **result)
{
- return dom_characterdata_create(doc, DOM_COMMENT_NODE,
- doc->nodenames[DOM_COMMENT_NODE], data, result);
+ return dom_comment_create(doc, doc->nodenames[DOM_COMMENT_NODE],
+ data, result);
}
/**
@@ -220,9 +225,9 @@ dom_exception dom_document_create_comment(struct dom_document *doc,
* finished with it.
*/
dom_exception dom_document_create_cdata_section(struct dom_document *doc,
- struct dom_string *data, struct dom_text **result)
+ struct dom_string *data, struct dom_cdata_section **result)
{
- return dom_text_create(doc, DOM_CDATA_SECTION_NODE,
+ return dom_cdata_section_create(doc,
doc->nodenames[DOM_CDATA_SECTION_NODE],
data, result);
}
@@ -245,12 +250,11 @@ dom_exception dom_document_create_cdata_section(struct dom_document *doc,
dom_exception dom_document_create_processing_instruction(
struct dom_document *doc, struct dom_string *target,
struct dom_string *data,
- struct dom_node **result)
+ struct dom_processing_instruction **result)
{
/** \todo is the use of target as the node name correct? */
- return dom_node_create(doc, DOM_PROCESSING_INSTRUCTION_NODE,
- target, data, result);
+ return dom_processing_instruction_create(doc, target, data, result);
}
/**
@@ -287,10 +291,10 @@ dom_exception dom_document_create_attribute(struct dom_document *doc,
* finished with it.
*/
dom_exception dom_document_create_entity_reference(struct dom_document *doc,
- struct dom_string *name, struct dom_node **result)
+ struct dom_string *name,
+ struct dom_entity_reference **result)
{
- return dom_node_create(doc, DOM_ENTITY_REFERENCE_NODE,
- name, NULL, result);
+ return dom_entity_reference_create(doc, name, NULL, result);
}
/**