r13601 dsilvers - in /trunk/libdom/src/core: characterdata.c characterdata.h text.c

netsurf at semichrome.net netsurf at semichrome.net
Sat Mar 24 16:45:24 GMT 2012


Author: dsilvers
Date: Sat Mar 24 11:45:24 2012
New Revision: 13601

URL: http://source.netsurf-browser.org?rev=13601&view=rev
Log:
get_text_content working for all textual nodes modulo processing instructions

Modified:
    trunk/libdom/src/core/characterdata.c
    trunk/libdom/src/core/characterdata.h
    trunk/libdom/src/core/text.c

Modified: trunk/libdom/src/core/characterdata.c
URL: http://source.netsurf-browser.org/trunk/libdom/src/core/characterdata.c?rev=13601&r1=13600&r2=13601&view=diff
==============================================================================
--- trunk/libdom/src/core/characterdata.c (original)
+++ trunk/libdom/src/core/characterdata.c Sat Mar 24 11:45:24 2012
@@ -26,7 +26,7 @@
 		{
 			DOM_NODE_EVENT_TARGET_VTABLE
 		},
-		DOM_NODE_VTABLE
+		DOM_NODE_VTABLE_CHARACTERDATA
 	},
 	DOM_CHARACTERDATA_VTABLE
 };
@@ -452,7 +452,21 @@
 	return _dom_dispatch_subtree_modified_event(doc, c->parent, &success);
 }
 
-
+dom_exception _dom_characterdata_get_text_content(dom_node_internal *node,
+						  dom_string **result)
+{
+	dom_characterdata *cdata = (dom_characterdata *)node;
+	
+	return dom_characterdata_get_data(cdata, result);
+}
+
+dom_exception _dom_characterdata_set_text_content(dom_node_internal *node,
+						  dom_string *content)
+{
+	dom_characterdata *cdata = (dom_characterdata *)node;
+	
+	return dom_characterdata_set_data(cdata, content);
+}
 
 /*----------------------------------------------------------------------*/
 

Modified: trunk/libdom/src/core/characterdata.h
URL: http://source.netsurf-browser.org/trunk/libdom/src/core/characterdata.h?rev=13601&r1=13600&r2=13601&view=diff
==============================================================================
--- trunk/libdom/src/core/characterdata.h (original)
+++ trunk/libdom/src/core/characterdata.h Sat Mar 24 11:45:24 2012
@@ -47,6 +47,12 @@
 dom_exception _dom_characterdata_replace_data(struct dom_characterdata *cdata,
 		unsigned long offset, unsigned long count,
 		dom_string *data);
+dom_exception _dom_characterdata_get_text_content(
+		dom_node_internal *node,
+		dom_string **result);
+dom_exception _dom_characterdata_set_text_content(
+		dom_node_internal *node,
+		dom_string *content);
 
 #define DOM_CHARACTERDATA_VTABLE \
 	_dom_characterdata_get_data, \
@@ -57,6 +63,45 @@
 	_dom_characterdata_insert_data, \
 	_dom_characterdata_delete_data, \
 	_dom_characterdata_replace_data 
+
+#define DOM_NODE_VTABLE_CHARACTERDATA \
+	_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_characterdata_get_text_content, /* override */ \
+	_dom_characterdata_set_text_content, /* override */ \
+	_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 
  *

Modified: trunk/libdom/src/core/text.c
URL: http://source.netsurf-browser.org/trunk/libdom/src/core/text.c?rev=13601&r1=13600&r2=13601&view=diff
==============================================================================
--- trunk/libdom/src/core/text.c (original)
+++ trunk/libdom/src/core/text.c Sat Mar 24 11:45:24 2012
@@ -26,7 +26,7 @@
 			{
 				DOM_NODE_EVENT_TARGET_VTABLE,
 			},
-			DOM_NODE_VTABLE
+			DOM_NODE_VTABLE_CHARACTERDATA
 		},
 		DOM_CHARACTERDATA_VTABLE
 	},




More information about the netsurf-commits mailing list