static char *
s_chtml10_start_form_tag(void *pdoc, Node *node)
{
- chtml10_t *chtml10;
- Doc *doc;
- request_rec *r;
- Attr *attr;
+ chtml10_t *chtml10;
+ Doc *doc;
+ request_rec *r;
+ Attr *attr;
+ char *attr_style = NULL;
+ char *attr_action = NULL;
+ char *attr_method = NULL;
chtml10 = GET_CHTML10(pdoc);
doc = chtml10->doc;
r = doc->r;
- W_L("<form");
-
/*--------------------------------------------------------------------------*/
/* Get Attributes */
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
- value = chxj_encoding_parameter(r, value);
- value = chxj_add_cookie_parameter(r, value, chtml10->cookie);
-
- W_L(" action=\"");
- W_V(value);
- W_L("\"");
+ attr_action = value;
}
break;
/*--------------------------------------------------------------------*/
/* CHTML 1.0 */
/*--------------------------------------------------------------------*/
- W_L(" method=\"");
- W_V(value);
- W_L("\"");
+ attr_method = value;
}
break;
}
break;
+ case 's':
+ case 'S':
+ if (strcasecmp(name, "style") == 0 && value && *value) {
+ attr_style = value;
+ }
+ break;
+
default:
break;
}
}
-
+ if (IS_CSS_ON(chtml10->entryp)) {
+ s_chtml10_push_and_get_now_style(pdoc, node, attr_style);
+ }
+ W_L("<form");
+ if (attr_action) {
+ attr_action = chxj_encoding_parameter(r, attr_action);
+ attr_action = chxj_add_cookie_parameter(r, attr_action, chtml10->cookie);
+ W_L(" action=\"");
+ W_V(attr_action);
+ W_L("\"");
+ }
+ if (attr_method) {
+ W_L(" method=\"");
+ W_V(attr_method);
+ W_L("\"");
+ }
W_L(">");
return chtml10->out;
r = doc->r;
W_L("</form>");
+ if (IS_CSS_ON(chtml10->entryp)) {
+ chxj_css_pop_prop_list(chtml10->css_prop_stack);
+ }
return chtml10->out;
}
void test_chtml10_form_tag_009()
{
#define TEST_STRING "<html><head></head><body><form method=\"post\" action=\"hogehoge\"></form></body></html>"
-#define RESULT_STRING "<html><head></head><body><form method=\"post\" action=\"hogehoge?_chxj_cc=test_cookie_id\"></form></body></html>"
+#define RESULT_STRING "<html><head></head><body><form action=\"hogehoge?_chxj_cc=test_cookie_id\" method=\"post\"></form></body></html>"
char *ret;
char *tmp;
device_table spec;
tmp = chxj_encoding(&r, TEST_STRING, &destlen);
ret = chxj_convert_chtml10(&r, &spec, tmp, destlen, &destlen, &entry, &cookie);
ret = chxj_rencoding(&r, ret, &destlen);
+ fprintf(stderr, "actual:[%s]\n", ret);
+ fprintf(stderr, "expect:[%s]\n", RESULT_STRING);
CU_ASSERT(ret != NULL);
CU_ASSERT(strcmp(RESULT_STRING, ret) == 0);
CU_ASSERT(destlen == sizeof(RESULT_STRING)-1);