From f7930870c0027672685ebc6df415240c4afe9a0b Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 7 Jul 2012 17:16:25 +0100 Subject: HTMLFormElement: Add basic attributes, enable 5 more tests --- include/dom/html/html_form_element.h | 32 ++++++++++++++++ src/html/html_form_element.c | 40 ++++++++++++++++++++ .../tests/level1/html/HTMLFormElement04.xml | 43 ++++++++++++++++++++++ .../tests/level1/html/HTMLFormElement04.xml.kfail | 43 ---------------------- .../tests/level1/html/HTMLFormElement05.xml | 42 +++++++++++++++++++++ .../tests/level1/html/HTMLFormElement05.xml.kfail | 42 --------------------- .../tests/level1/html/HTMLFormElement06.xml | 42 +++++++++++++++++++++ .../tests/level1/html/HTMLFormElement06.xml.kfail | 42 --------------------- .../tests/level1/html/HTMLFormElement07.xml | 42 +++++++++++++++++++++ .../tests/level1/html/HTMLFormElement07.xml.kfail | 42 --------------------- .../tests/level1/html/HTMLFormElement08.xml | 42 +++++++++++++++++++++ .../tests/level1/html/HTMLFormElement08.xml.kfail | 42 --------------------- 12 files changed, 283 insertions(+), 211 deletions(-) create mode 100644 test/testcases/tests/level1/html/HTMLFormElement04.xml delete mode 100644 test/testcases/tests/level1/html/HTMLFormElement04.xml.kfail create mode 100644 test/testcases/tests/level1/html/HTMLFormElement05.xml delete mode 100644 test/testcases/tests/level1/html/HTMLFormElement05.xml.kfail create mode 100644 test/testcases/tests/level1/html/HTMLFormElement06.xml delete mode 100644 test/testcases/tests/level1/html/HTMLFormElement06.xml.kfail create mode 100644 test/testcases/tests/level1/html/HTMLFormElement07.xml delete mode 100644 test/testcases/tests/level1/html/HTMLFormElement07.xml.kfail create mode 100644 test/testcases/tests/level1/html/HTMLFormElement08.xml delete mode 100644 test/testcases/tests/level1/html/HTMLFormElement08.xml.kfail diff --git a/include/dom/html/html_form_element.h b/include/dom/html/html_form_element.h index 230846c..c4ee1d8 100644 --- a/include/dom/html/html_form_element.h +++ b/include/dom/html/html_form_element.h @@ -9,6 +9,7 @@ #define dom_html_form_element_h_ #include +#include struct dom_html_collection; @@ -18,6 +19,37 @@ dom_exception dom_html_form_element_get_elements(dom_html_form_element *ele, struct dom_html_collection **col); dom_exception dom_html_form_element_get_length(dom_html_form_element *ele, unsigned long *len); + +dom_exception dom_html_form_element_get_accept_charset( + dom_html_form_element *ele, dom_string **accept_charset); + +dom_exception dom_html_form_element_set_accept_charset( + dom_html_form_element *ele, dom_string *accept_charset); + +dom_exception dom_html_form_element_get_action( + dom_html_form_element *ele, dom_string **action); + +dom_exception dom_html_form_element_set_action( + dom_html_form_element *ele, dom_string *action); + +dom_exception dom_html_form_element_get_enctype( + dom_html_form_element *ele, dom_string **enctype); + +dom_exception dom_html_form_element_set_enctype( + dom_html_form_element *ele, dom_string *enctype); + +dom_exception dom_html_form_element_get_method( + dom_html_form_element *ele, dom_string **method); + +dom_exception dom_html_form_element_set_method( + dom_html_form_element *ele, dom_string *method); + +dom_exception dom_html_form_element_get_target( + dom_html_form_element *ele, dom_string **target); + +dom_exception dom_html_form_element_set_target( + dom_html_form_element *ele, dom_string *target); + dom_exception dom_html_form_element_submit(dom_html_form_element *ele); dom_exception dom_html_form_element_reset(dom_html_form_element *ele); 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 #include +#include + #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 * diff --git a/test/testcases/tests/level1/html/HTMLFormElement04.xml b/test/testcases/tests/level1/html/HTMLFormElement04.xml new file mode 100644 index 0000000..4077e36 --- /dev/null +++ b/test/testcases/tests/level1/html/HTMLFormElement04.xml @@ -0,0 +1,43 @@ + + + + + + + +HTMLFormElement04 +NIST + + The acceptCharset attribute specifies the list of character sets + supported by the server. + + Retrieve the acceptCharset attribute and examine its value. + +Mary Brady +2002-02-22 + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/html/HTMLFormElement04.xml.kfail b/test/testcases/tests/level1/html/HTMLFormElement04.xml.kfail deleted file mode 100644 index 4077e36..0000000 --- a/test/testcases/tests/level1/html/HTMLFormElement04.xml.kfail +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - -HTMLFormElement04 -NIST - - The acceptCharset attribute specifies the list of character sets - supported by the server. - - Retrieve the acceptCharset attribute and examine its value. - -Mary Brady -2002-02-22 - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/html/HTMLFormElement05.xml b/test/testcases/tests/level1/html/HTMLFormElement05.xml new file mode 100644 index 0000000..54a3436 --- /dev/null +++ b/test/testcases/tests/level1/html/HTMLFormElement05.xml @@ -0,0 +1,42 @@ + + + + + + + +HTMLFormElement05 +NIST + + The action attribute specifies the server-side form handler. + + Retrieve the action attribute and examine its value. + +Mary Brady +2002-02-22 + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/html/HTMLFormElement05.xml.kfail b/test/testcases/tests/level1/html/HTMLFormElement05.xml.kfail deleted file mode 100644 index 54a3436..0000000 --- a/test/testcases/tests/level1/html/HTMLFormElement05.xml.kfail +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - -HTMLFormElement05 -NIST - - The action attribute specifies the server-side form handler. - - Retrieve the action attribute and examine its value. - -Mary Brady -2002-02-22 - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/html/HTMLFormElement06.xml b/test/testcases/tests/level1/html/HTMLFormElement06.xml new file mode 100644 index 0000000..fb1ca95 --- /dev/null +++ b/test/testcases/tests/level1/html/HTMLFormElement06.xml @@ -0,0 +1,42 @@ + + + + + + + +HTMLFormElement06 +NIST + + The enctype attribute specifies the content of the submitted form. + + Retrieve the enctype attribute and examine its value. + +Mary Brady +2002-02-22 + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/html/HTMLFormElement06.xml.kfail b/test/testcases/tests/level1/html/HTMLFormElement06.xml.kfail deleted file mode 100644 index fb1ca95..0000000 --- a/test/testcases/tests/level1/html/HTMLFormElement06.xml.kfail +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - -HTMLFormElement06 -NIST - - The enctype attribute specifies the content of the submitted form. - - Retrieve the enctype attribute and examine its value. - -Mary Brady -2002-02-22 - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/html/HTMLFormElement07.xml b/test/testcases/tests/level1/html/HTMLFormElement07.xml new file mode 100644 index 0000000..897b63d --- /dev/null +++ b/test/testcases/tests/level1/html/HTMLFormElement07.xml @@ -0,0 +1,42 @@ + + + + + + + +HTMLFormElement07 +NIST + + The method attribute specifies the HTTP method used to submit the form. + + Retrieve the method attribute and examine its value. + +Mary Brady +2002-02-22 + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/html/HTMLFormElement07.xml.kfail b/test/testcases/tests/level1/html/HTMLFormElement07.xml.kfail deleted file mode 100644 index 897b63d..0000000 --- a/test/testcases/tests/level1/html/HTMLFormElement07.xml.kfail +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - -HTMLFormElement07 -NIST - - The method attribute specifies the HTTP method used to submit the form. - - Retrieve the method attribute and examine its value. - -Mary Brady -2002-02-22 - - - - - - - - - - - - - diff --git a/test/testcases/tests/level1/html/HTMLFormElement08.xml b/test/testcases/tests/level1/html/HTMLFormElement08.xml new file mode 100644 index 0000000..1a691cb --- /dev/null +++ b/test/testcases/tests/level1/html/HTMLFormElement08.xml @@ -0,0 +1,42 @@ + + + + + + + +HTMLFormElement08 +NIST + + The target attribute specifies the frame to render the resource in. + + Retrieve the target attribute and examine it's value. + +Rick Rivello +2002-05-09 + + + + + + + + + + + + + diff --git a/test/testcases/tests/level1/html/HTMLFormElement08.xml.kfail b/test/testcases/tests/level1/html/HTMLFormElement08.xml.kfail deleted file mode 100644 index 1a691cb..0000000 --- a/test/testcases/tests/level1/html/HTMLFormElement08.xml.kfail +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - -HTMLFormElement08 -NIST - - The target attribute specifies the frame to render the resource in. - - Retrieve the target attribute and examine it's value. - -Rick Rivello -2002-05-09 - - - - - - - - - - - - - -- cgit v1.2.3