summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@netsurf-browser.org>2012-03-24 16:56:00 +0000
committerDaniel Silverstone <dsilvers@netsurf-browser.org>2012-03-24 16:56:00 +0000
commit3b745f0b5e37812ae2d2918ce2762b9e6c726b26 (patch)
tree836dba3cdae88e27a14bec3ae22ade1b5dd8a3ae /src/core
parentefd1b61ffdbb92f6557e960a4590cd0c403f58df (diff)
downloadlibdom-3b745f0b5e37812ae2d2918ce2762b9e6c726b26.tar.gz
libdom-3b745f0b5e37812ae2d2918ce2762b9e6c726b26.tar.bz2
Documents and document types do not have text content
svn path=/trunk/libdom/; revision=13602
Diffstat (limited to 'src/core')
-rw-r--r--src/core/document.c21
-rw-r--r--src/core/document.h44
-rw-r--r--src/core/document_type.c21
-rw-r--r--src/core/document_type.h44
4 files changed, 128 insertions, 2 deletions
diff --git a/src/core/document.c b/src/core/document.c
index df5fffa..3f7ce77 100644
--- a/src/core/document.c
+++ b/src/core/document.c
@@ -47,7 +47,7 @@ static struct dom_document_vtable document_vtable = {
{
DOM_NODE_EVENT_TARGET_VTABLE
},
- DOM_NODE_VTABLE
+ DOM_NODE_VTABLE_DOCUMENT
},
DOM_DOCUMENT_VTABLE
};
@@ -1043,6 +1043,25 @@ dom_exception _dom_document_rename_node(dom_document *doc,
return DOM_NOT_SUPPORTED_ERR;
}
+dom_exception _dom_document_get_text_content(dom_node_internal *node,
+ dom_string **result)
+{
+ UNUSED(node);
+
+ *result = NULL;
+
+ return DOM_NO_ERR;
+}
+
+dom_exception _dom_document_set_text_content(dom_node_internal *node,
+ dom_string *content)
+{
+ UNUSED(node);
+ UNUSED(content);
+
+ return DOM_NO_ERR;
+}
+
/*-----------------------------------------------------------------------*/
/* Overload protected virtual functions */
diff --git a/src/core/document.h b/src/core/document.h
index 002b0ca..4f9990c 100644
--- a/src/core/document.h
+++ b/src/core/document.h
@@ -138,6 +138,11 @@ dom_exception _dom_document_rename_node(dom_document *doc,
dom_string *namespace, dom_string *qname,
dom_node **result);
+dom_exception _dom_document_get_text_content(dom_node_internal *node,
+ dom_string **result);
+dom_exception _dom_document_set_text_content(dom_node_internal *node,
+ dom_string *content);
+
#define DOM_DOCUMENT_VTABLE \
_dom_document_get_doctype, \
_dom_document_get_implementation, \
@@ -172,6 +177,45 @@ dom_exception _dom_document_rename_node(dom_document *doc,
_dom_document_rename_node
/* End of vtable */
+#define DOM_NODE_VTABLE_DOCUMENT \
+ _dom_node_get_node_name, \
+ _dom_node_get_node_value, \
+ _dom_node_set_node_value, \
+ _dom_node_get_node_type, \
+ _dom_node_get_parent_node, \
+ _dom_node_get_child_nodes, \
+ _dom_node_get_first_child, \
+ _dom_node_get_last_child, \
+ _dom_node_get_previous_sibling, \
+ _dom_node_get_next_sibling, \
+ _dom_node_get_attributes, \
+ _dom_node_get_owner_document, \
+ _dom_node_insert_before, \
+ _dom_node_replace_child, \
+ _dom_node_remove_child, \
+ _dom_node_append_child, \
+ _dom_node_has_child_nodes, \
+ _dom_node_clone_node, \
+ _dom_node_normalize, \
+ _dom_node_is_supported, \
+ _dom_node_get_namespace, \
+ _dom_node_get_prefix, \
+ _dom_node_set_prefix, \
+ _dom_node_get_local_name, \
+ _dom_node_has_attributes, \
+ _dom_node_get_base, \
+ _dom_node_compare_document_position, \
+ _dom_document_get_text_content, \
+ _dom_document_set_text_content, \
+ _dom_node_is_same, \
+ _dom_node_lookup_prefix, \
+ _dom_node_is_default_namespace, \
+ _dom_node_lookup_namespace, \
+ _dom_node_is_equal, \
+ _dom_node_get_feature, \
+ _dom_node_set_user_data, \
+ _dom_node_get_user_data
+
/** \todo Unused! */
/**
* The internal used vtable for document
diff --git a/src/core/document_type.c b/src/core/document_type.c
index 89a94f4..a01abce 100644
--- a/src/core/document_type.c
+++ b/src/core/document_type.c
@@ -32,7 +32,7 @@ static struct dom_document_type_vtable document_type_vtable = {
{
DOM_NODE_EVENT_TARGET_VTABLE
},
- DOM_NODE_VTABLE
+ DOM_NODE_VTABLE_DOCUMENT_TYPE
},
DOM_DOCUMENT_TYPE_VTABLE
};
@@ -305,6 +305,25 @@ dom_exception _dom_document_type_get_internal_subset(
return DOM_NOT_SUPPORTED_ERR;
}
+dom_exception _dom_document_type_get_text_content(dom_node_internal *node,
+ dom_string **result)
+{
+ UNUSED(node);
+
+ *result = NULL;
+
+ return DOM_NO_ERR;
+}
+
+dom_exception _dom_document_type_set_text_content(dom_node_internal *node,
+ dom_string *content)
+{
+ UNUSED(node);
+ UNUSED(content);
+
+ return DOM_NO_ERR;
+}
+
/*-----------------------------------------------------------------------*/
/* Overload protected virtual functions */
diff --git a/src/core/document_type.h b/src/core/document_type.h
index e9b1dd5..bccc469 100644
--- a/src/core/document_type.h
+++ b/src/core/document_type.h
@@ -43,6 +43,11 @@ dom_exception _dom_document_type_get_internal_subset(
dom_document_type *doc_type,
dom_string **result);
+dom_exception _dom_document_type_get_text_content(dom_node_internal *node,
+ dom_string **result);
+dom_exception _dom_document_type_set_text_content(dom_node_internal *node,
+ dom_string *content);
+
#define DOM_DOCUMENT_TYPE_VTABLE \
_dom_document_type_get_name, \
_dom_document_type_get_entities, \
@@ -51,6 +56,45 @@ dom_exception _dom_document_type_get_internal_subset(
_dom_document_type_get_system_id, \
_dom_document_type_get_internal_subset
+#define DOM_NODE_VTABLE_DOCUMENT_TYPE \
+ _dom_node_get_node_name, \
+ _dom_node_get_node_value, \
+ _dom_node_set_node_value, \
+ _dom_node_get_node_type, \
+ _dom_node_get_parent_node, \
+ _dom_node_get_child_nodes, \
+ _dom_node_get_first_child, \
+ _dom_node_get_last_child, \
+ _dom_node_get_previous_sibling, \
+ _dom_node_get_next_sibling, \
+ _dom_node_get_attributes, \
+ _dom_node_get_owner_document, \
+ _dom_node_insert_before, \
+ _dom_node_replace_child, \
+ _dom_node_remove_child, \
+ _dom_node_append_child, \
+ _dom_node_has_child_nodes, \
+ _dom_node_clone_node, \
+ _dom_node_normalize, \
+ _dom_node_is_supported, \
+ _dom_node_get_namespace, \
+ _dom_node_get_prefix, \
+ _dom_node_set_prefix, \
+ _dom_node_get_local_name, \
+ _dom_node_has_attributes, \
+ _dom_node_get_base, \
+ _dom_node_compare_document_position, \
+ _dom_document_type_get_text_content, \
+ _dom_document_type_set_text_content, \
+ _dom_node_is_same, \
+ _dom_node_lookup_prefix, \
+ _dom_node_is_default_namespace, \
+ _dom_node_lookup_namespace, \
+ _dom_node_is_equal, \
+ _dom_node_get_feature, \
+ _dom_node_set_user_data, \
+ _dom_node_get_user_data
+
/* Following comes the protected vtable */
void _dom_dt_destroy(dom_node_internal *node);
dom_exception _dom_dt_copy(dom_node_internal *old, dom_node_internal **copy);