[w3m-dev 02770] form element outside <form>..</form>

From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2001-12-27 18:01:52 +00:00
parent d515bf1cfd
commit 0fb25226f1
4 changed files with 36 additions and 7 deletions
+11 -1
View File
@@ -1,3 +1,13 @@
2001-12-28 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02770] form element outside <form>..</form>
* main.c (_followForm): check whether parent action is "none"
* form.c (internal_action): add "none"
* form.c (do_internal): check internal_action[i].rout
* file.c (process_input): check cur_form_id
* file.c (process_select): ditto
* file.c (process_textarea): ditto
2001-12-28 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02769] <form>..</form> as block element
@@ -1738,4 +1748,4 @@
* release-0-2-1
* import w3m-0.2.1
$Id: ChangeLog,v 1.193 2001/12/27 17:56:02 ukai Exp $
$Id: ChangeLog,v 1.194 2001/12/27 18:01:52 ukai Exp $
+16 -1
View File
@@ -1,4 +1,4 @@
/* $Id: file.c,v 1.38 2001/12/27 17:56:03 ukai Exp $ */
/* $Id: file.c,v 1.39 2001/12/27 18:01:52 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -2406,6 +2406,11 @@ process_input(struct parsed_tag *tag)
char *qq = "";
int qlen = 0;
if (cur_form_id < 0) {
char *s = "<form_int method=internal action=none>";
process_form(parse_tag(&s, TRUE));
}
p = "text";
parsedtag_get_value(tag, ATTR_TYPE, &p);
q = NULL;
@@ -2578,6 +2583,11 @@ process_select(struct parsed_tag *tag)
{
char *p;
if (cur_form_id < 0) {
char *s = "<form_int method=internal action=none>";
process_form(parse_tag(&s, TRUE));
}
p = "";
parsedtag_get_value(tag, ATTR_NAME, &p);
cur_select = Strnew_charp(p);
@@ -2742,6 +2752,11 @@ process_textarea(struct parsed_tag *tag, int width)
{
char *p;
if (cur_form_id < 0) {
char *s = "<form_int method=internal action=none>";
process_form(parse_tag(&s, TRUE));
}
p = "";
parsedtag_get_value(tag, ATTR_NAME, &p);
cur_textarea = Strnew_charp(p);
+4 -2
View File
@@ -1,4 +1,4 @@
/* $Id: form.c,v 1.9 2001/12/27 17:37:49 ukai Exp $ */
/* $Id: form.c,v 1.10 2001/12/27 18:01:52 ukai Exp $ */
/*
* HTML forms
*/
@@ -31,6 +31,7 @@ struct {
#ifdef USE_COOKIE
{"cookie", set_cookie_flag},
#endif /* USE_COOKIE */
{"none", NULL},
{NULL, NULL},
};
/* *INDENT-ON* */
@@ -510,7 +511,8 @@ do_internal(char *action, char *data)
for (i = 0; internal_action[i].action; i++) {
if (strcasecmp(internal_action[i].action, action) == 0) {
internal_action[i].rout(cgistr2tagarg(data));
if (internal_action[i].rout)
internal_action[i].rout(cgistr2tagarg(data));
return;
}
}
+5 -3
View File
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.52 2001/12/27 17:43:24 ukai Exp $ */
/* $Id: main.c,v 1.53 2001/12/27 18:01:52 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -3020,9 +3020,11 @@ _followForm(int submit)
buf->form_submit = save_submit_formlist(fi);
}
}
else if ((fi->parent->method == FORM_METHOD_INTERNAL && Strcmp_charp(fi->parent->action, "map") == 0) || Currentbuf->bufferprop & BP_INTERNAL) { /* internal */
else if ((fi->parent->method == FORM_METHOD_INTERNAL &&
(!Strcmp_charp(fi->parent->action, "map") ||
!Strcmp_charp(fi->parent->action, "none"))) ||
Currentbuf->bufferprop & BP_INTERNAL) { /* internal */
do_internal(tmp2->ptr, tmp->ptr);
return;
}
else {
disp_err_message("Can't send form because of illegal method.",