summaryrefslogtreecommitdiff
path: root/src/core/document.h
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2010-08-30 13:06:19 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2010-08-30 13:06:19 +0000
commitb657c277f517f4ab0a4da21e4f8c4cb6f8f53013 (patch)
tree4ce25caee01c0a2a2ebbe052999b5eb8a2fbe2e3 /src/core/document.h
parent229af12d7ab2c071a6888eb8ffc49bb0bbeb9ddd (diff)
downloadlibdom-b657c277f517f4ab0a4da21e4f8c4cb6f8f53013.tar.gz
libdom-b657c277f517f4ab0a4da21e4f8c4cb6f8f53013.tar.bz2
Merge branches/struggleyb/libdom-html to trunk.
A few additional fixes to reduce the number of regressions to single figures. svn path=/trunk/dom/; revision=10724
Diffstat (limited to 'src/core/document.h')
-rw-r--r--src/core/document.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/core/document.h b/src/core/document.h
index a7cab6d..e657530 100644
--- a/src/core/document.h
+++ b/src/core/document.h
@@ -12,6 +12,7 @@
#include <stddef.h>
#include <dom/core/node.h>
+#include <dom/core/document.h>
#include "core/string.h"
#include "core/node.h"
@@ -66,6 +67,12 @@ struct dom_document {
/**< The DocumentEVent interface */
};
+/* Create a DOM document */
+dom_exception _dom_document_create(struct dom_implementation *impl,
+ dom_alloc alloc, void *pw,
+ dom_events_default_action_fetcher daf,
+ struct dom_document **doc);
+
/* Initialise the document */
dom_exception _dom_document_initialise(struct dom_document *doc,
struct dom_implementation *impl, dom_alloc alloc, void *pw,
@@ -194,6 +201,28 @@ dom_exception _dom_document_rename_node(struct dom_document *doc,
_dom_document_rename_node
/* End of vtable */
+/**
+ * The internal used vtable for document
+ */
+struct dom_document_protected_vtable {
+ struct dom_node_protect_vtable base;
+ dom_exception (*dom_document_get_base)(dom_document *doc,
+ struct dom_string **base_uri);
+ /* Get the document's base uri */
+};
+
+typedef struct dom_document_protected_vtable dom_document_protected_vtable;
+
+/* Get the document's base URI */
+static inline dom_exception dom_document_get_base(dom_document *doc,
+ struct dom_string **base_uri)
+{
+ struct dom_node_internal *node = (struct dom_node_internal *) doc;
+ return ((dom_document_protected_vtable *) node->vtable)->
+ dom_document_get_base(doc, base_uri);
+}
+#define dom_document_get_base(d, b) dom_document_get_base( \
+ (dom_document *) (d), (struct dom_string **) (b))
/* Following comes the protected vtable */
void _dom_document_destroy(struct dom_node_internal *node);