From 2a0e5194974f8f6c181955e9368f4872442ec259 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 25 Mar 2012 11:24:12 +0000 Subject: Egregious hack so missing form controls don't cause box construction to abort svn path=/trunk/netsurf/; revision=13680 --- render/libdom_binding.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/render/libdom_binding.c b/render/libdom_binding.c index 4b86a8fd6..9e6d7685b 100644 --- a/render/libdom_binding.c +++ b/render/libdom_binding.c @@ -100,7 +100,21 @@ struct form *binding_get_forms(void *ctx) struct form_control *binding_get_control_for_node(void *ctx, dom_node *node) { - return NULL; + /** \todo implement properly */ + struct form_control *ctl = form_new_control(node, GADGET_HIDDEN); + if (ctl != NULL) { + ctl->value = strdup(""); + ctl->initial_value = strdup(""); + ctl->name = strdup("foo"); + + if (ctl->value == NULL || ctl->initial_value == NULL || + ctl->name == NULL) { + form_free_control(ctl); + ctl = NULL; + } + } + + return ctl; } void binding_destroy_document(dom_document *doc) -- cgit v1.2.3