summaryrefslogtreecommitdiff
path: root/render/box_construct.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2012-07-13 17:33:15 -0600
committerVincent Sanders <vince@netsurf-browser.org>2012-07-13 17:37:22 -0600
commitd7289f67012f14471f4ccab911c3a976af52625a (patch)
tree3192bb49922eb7f5fd1d3fb80640d1fb15bfb0da /render/box_construct.c
parent019be7616caf377f5b233c98206bc0c5d45a9793 (diff)
downloadnetsurf-d7289f67012f14471f4ccab911c3a976af52625a.tar.gz
netsurf-d7289f67012f14471f4ccab911c3a976af52625a.tar.bz2
remove parser binding layer
Diffstat (limited to 'render/box_construct.c')
-rw-r--r--render/box_construct.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/render/box_construct.c b/render/box_construct.c
index c62f4390d..0776a7e86 100644
--- a/render/box_construct.c
+++ b/render/box_construct.c
@@ -146,6 +146,25 @@ static const struct element_entry element_table[] = {
};
#define ELEMENT_TABLE_COUNT (sizeof(element_table) / sizeof(element_table[0]))
+static struct form_control *binding_get_control_for_node(void *ctx, dom_node *node)
+{
+ /** \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;
+}
+
/**
* Construct a box tree from an xml tree and stylesheets.
*
@@ -2471,7 +2490,7 @@ bool box_input(BOX_SPECIAL_PARAMS)
dom_element_get_attribute(n, kstr_type, &type);
- gadget = binding_get_control_for_node(content->parser_binding, n);
+ gadget = binding_get_control_for_node(content->parser, n);
if (gadget == NULL)
goto no_memory;
box->gadget = gadget;
@@ -2638,7 +2657,7 @@ bool box_button(BOX_SPECIAL_PARAMS)
{
struct form_control *gadget;
- gadget = binding_get_control_for_node(content->parser_binding, n);
+ gadget = binding_get_control_for_node(content->parser, n);
if (!gadget)
return false;
@@ -2666,7 +2685,7 @@ bool box_select(BOX_SPECIAL_PARAMS)
dom_node *next, *next2;
dom_exception err;
- gadget = binding_get_control_for_node(content->parser_binding, n);
+ gadget = binding_get_control_for_node(content->parser, n);
if (gadget == NULL)
return false;
@@ -2879,7 +2898,7 @@ bool box_textarea(BOX_SPECIAL_PARAMS)
size_t len;
box->type = BOX_INLINE_BLOCK;
- box->gadget = binding_get_control_for_node(content->parser_binding, n);
+ box->gadget = binding_get_control_for_node(content->parser, n);
if (box->gadget == NULL)
return false;
box->gadget->box = box;