summaryrefslogtreecommitdiff
path: root/src/html/html_hr_element.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2016-02-05 16:34:50 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2016-02-05 16:34:50 +0000
commitbdff6f97ec9aad29c276632fb154e89f4ddf972a (patch)
treea19e00cd39fdd7a0026e4a6571a3d97569792ae8 /src/html/html_hr_element.c
parent7eb3726a8e6057f50c05d53137421cc2f994dca9 (diff)
downloadlibdom-bdff6f97ec9aad29c276632fb154e89f4ddf972a.tar.gz
libdom-bdff6f97ec9aad29c276632fb154e89f4ddf972a.tar.bz2
Fix: Proper copy constructor for HTMLHRElement.
Diffstat (limited to 'src/html/html_hr_element.c')
-rw-r--r--src/html/html_hr_element.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/html/html_hr_element.c b/src/html/html_hr_element.c
index 6d96c84..e6086f5 100644
--- a/src/html/html_hr_element.c
+++ b/src/html/html_hr_element.c
@@ -137,10 +137,39 @@ void _dom_virtual_html_hr_element_destroy(dom_node_internal *node)
}
/* The virtual copy function, see src/core/node.c for detail */
-dom_exception _dom_html_hr_element_copy(dom_node_internal *old,
- dom_node_internal **copy)
+dom_exception _dom_html_hr_element_copy(
+ dom_node_internal *old, dom_node_internal **copy)
{
- return _dom_html_element_copy(old, copy);
+ dom_html_hr_element *new_node;
+ dom_exception err;
+
+ new_node = malloc(sizeof(dom_html_hr_element));
+ if (new_node == NULL)
+ return DOM_NO_MEM_ERR;
+
+ err = dom_html_hr_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_hr_element_copy_internal(
+ dom_html_hr_element *old,
+ dom_html_hr_element *new)
+{
+ dom_exception err;
+
+ err = dom_html_element_copy_internal(old, new);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ return DOM_NO_ERR;
}
/*-----------------------------------------------------------------------*/