summaryrefslogtreecommitdiff
path: root/src/html
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 17:16:25 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2012-07-07 17:16:25 +0100
commitf7930870c0027672685ebc6df415240c4afe9a0b (patch)
tree32347ae9560eca482573b864ef48079dd4b59830 /src/html
parent4bd9b5366d2eb5d6430f75a0ccd7ea4cb10ff838 (diff)
downloadlibdom-f7930870c0027672685ebc6df415240c4afe9a0b.tar.gz
libdom-f7930870c0027672685ebc6df415240c4afe9a0b.tar.bz2
HTMLFormElement: Add basic attributes, enable 5 more tests
Diffstat (limited to 'src/html')
-rw-r--r--src/html/html_form_element.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/html/html_form_element.c b/src/html/html_form_element.c
index 83af37a..0688cd6 100644
--- a/src/html/html_form_element.c
+++ b/src/html/html_form_element.c
@@ -8,6 +8,8 @@
#include <assert.h>
#include <stdlib.h>
+#include <dom/html/html_form_element.h>
+
#include "html/html_form_element.h"
#include "html/html_collection.h"
@@ -182,6 +184,44 @@ dom_exception dom_html_form_element_get_length(dom_html_form_element *ele,
return dom_html_collection_get_length(ele->col, len);
}
+#define SIMPLE_GET_SET(fattr,attr) \
+dom_exception dom_html_form_element_get_##fattr(dom_html_form_element *element, \
+ dom_string **fattr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->memoised[hds_##attr]; \
+ \
+ ret = dom_element_get_attribute(element, _memo_##attr, fattr); \
+ \
+ return ret; \
+} \
+ \
+dom_exception dom_html_form_element_set_##fattr(dom_html_form_element *element, \
+ dom_string *fattr) \
+{ \
+ dom_exception ret; \
+ dom_string *_memo_##attr; \
+ \
+ _memo_##attr = \
+ ((struct dom_html_document *) \
+ ((struct dom_node_internal *)element)->owner)->memoised[hds_##attr]; \
+ \
+ ret = dom_element_set_attribute(element, _memo_##attr, fattr); \
+ \
+ return ret; \
+}
+
+SIMPLE_GET_SET(accept_charset,accept_charset)
+SIMPLE_GET_SET(action,action)
+SIMPLE_GET_SET(enctype,enctype)
+SIMPLE_GET_SET(method,method)
+SIMPLE_GET_SET(target,target)
+
+
/**
* Submit this form
*