summaryrefslogtreecommitdiff
path: root/src/html/html_ulist_element.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2016-02-05 18:22:15 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2016-02-05 18:22:15 +0000
commitd19eda00d250fae4b18ce41c941e709d7d384ff5 (patch)
treefe7e75b5deb3fcf3d1b2864f962ffa2117480eef /src/html/html_ulist_element.c
parent0f6942769b6d85b53e8348ed46c4b309d6b118bb (diff)
downloadlibdom-d19eda00d250fae4b18ce41c941e709d7d384ff5.tar.gz
libdom-d19eda00d250fae4b18ce41c941e709d7d384ff5.tar.bz2
Fix: Proper copy constructor for HTMLUListElement.
Diffstat (limited to 'src/html/html_ulist_element.c')
-rw-r--r--src/html/html_ulist_element.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/html/html_ulist_element.c b/src/html/html_ulist_element.c
index 624c85f..f2b87fb 100644
--- a/src/html/html_ulist_element.c
+++ b/src/html/html_ulist_element.c
@@ -133,10 +133,39 @@ void _dom_virtual_html_u_list_element_destroy(dom_node_internal *node)
}
/* The virtual copy function, see src/core/node.c for detail */
-dom_exception _dom_html_u_list_element_copy(dom_node_internal *old,
- dom_node_internal **copy)
+dom_exception _dom_html_u_list_element_copy(
+ dom_node_internal *old, dom_node_internal **copy)
{
- return _dom_html_element_copy(old, copy);
+ dom_html_u_list_element *new_node;
+ dom_exception err;
+
+ new_node = malloc(sizeof(dom_html_u_list_element));
+ if (new_node == NULL)
+ return DOM_NO_MEM_ERR;
+
+ err = dom_html_u_list_element_copy_internal(old, new_node);
+ if (err != DOM_NO_ERR) {
+ free(new_node);
+ return err;
+ }
+
+ *copy = (dom_node_internal *) new_node;
+
+ return DOM_NO_ERR;
+}
+
+dom_exception _dom_html_u_list_element_copy_internal(
+ dom_html_u_list_element *old,
+ dom_html_u_list_element *new)
+{
+ dom_exception err;
+
+ err = dom_html_element_copy_internal(old, new);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ return DOM_NO_ERR;
}
/*-----------------------------------------------------------------------*/