summaryrefslogtreecommitdiff
path: root/src/html/html_button_element.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2016-02-05 16:02:28 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2016-02-05 16:02:28 +0000
commit42bcd5d6f7a124a0b1680cd781effa2c396e387d (patch)
tree0b6f9fc8d5878960fb703b04076a22996a0a4c4e /src/html/html_button_element.c
parent6c8d440459087acecfcb4e492573371fd6443f23 (diff)
downloadlibdom-42bcd5d6f7a124a0b1680cd781effa2c396e387d.tar.gz
libdom-42bcd5d6f7a124a0b1680cd781effa2c396e387d.tar.bz2
Provide generic copy constructor for HTMLButtonElement.
Diffstat (limited to 'src/html/html_button_element.c')
-rw-r--r--src/html/html_button_element.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/html/html_button_element.c b/src/html/html_button_element.c
index a9c34d5..a732247 100644
--- a/src/html/html_button_element.c
+++ b/src/html/html_button_element.c
@@ -142,10 +142,39 @@ void _dom_virtual_html_button_element_destroy(dom_node_internal *node)
}
/* The virtual copy function, see src/core/node.c for detail */
-dom_exception _dom_html_button_element_copy(dom_node_internal *old,
- dom_node_internal **copy)
+dom_exception _dom_html_button_element_copy(
+ dom_node_internal *old, dom_node_internal **copy)
{
- return _dom_html_element_copy(old, copy);
+ dom_html_button_element *new_node;
+ dom_exception err;
+
+ new_node = malloc(sizeof(dom_html_button_element));
+ if (new_node == NULL)
+ return DOM_NO_MEM_ERR;
+
+ err = dom_html_button_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_button_element_copy_internal(
+ dom_html_button_element *old,
+ dom_html_button_element *new)
+{
+ dom_exception err;
+
+ err = dom_html_element_copy_internal(old, new);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ return DOM_NO_ERR;
}
/*-----------------------------------------------------------------------*/