summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 22:21:26 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 22:21:26 +0100
commit146bda077e00e3feffc3748af681f10494fc9c5c (patch)
tree43d10c947692a85d7b40973ae77bd0f0c968cff4 /bindings
parent50d83f430d109472dee45910851275fe189b0fdb (diff)
downloadlibdom-146bda077e00e3feffc3748af681f10494fc9c5c.tar.gz
libdom-146bda077e00e3feffc3748af681f10494fc9c5c.tar.bz2
HTML{{,Button,Select,Form}Element,Document,Element,{,Options}Collection}: Make buttons work and forms contain their correct buttons
Diffstat (limited to 'bindings')
-rw-r--r--bindings/hubbub/parser.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/bindings/hubbub/parser.c b/bindings/hubbub/parser.c
index b42645d..3ec2366 100644
--- a/bindings/hubbub/parser.c
+++ b/bindings/hubbub/parser.c
@@ -20,6 +20,10 @@
#include "core/document.h"
#include "core/string.h"
+#include "core/node.h"
+
+#include "html/html_document.h"
+#include "html/html_button_element.h"
#include <libwapcaplet/libwapcaplet.h>
@@ -465,10 +469,24 @@ static hubbub_error has_children(void *parser, void *node, bool *result)
static hubbub_error form_associate(void *parser, void *form, void *node)
{
- UNUSED(parser);
- UNUSED(form);
- UNUSED(node);
-
+ dom_hubbub_parser *dom_parser = (dom_hubbub_parser *) parser;
+ dom_html_form_element *form_ele = form;
+ dom_node_internal *ele = node;
+ dom_html_document *doc = (dom_html_document *)ele->owner;
+ dom_exception err = DOM_NO_ERR;
+
+ /* Determine the kind of the node we have here. */
+ if (dom_string_caseless_isequal(ele->name,
+ doc->memoised[hds_BUTTON])) {
+ err = _dom_html_button_element_set_form(
+ (dom_html_button_element *)node, form_ele);
+ if (err != DOM_NO_ERR) {
+ dom_parser->msg(DOM_MSG_CRITICAL, dom_parser->mctx,
+ "Error in form_associate");
+ return HUBBUB_UNKNOWN;
+ }
+ }
+
return HUBBUB_OK;
}