[w3m-dev 02578]

From: Fumitoshi UKAI <ukai@debian.or.jp>
<input type="image">
This commit is contained in:
Fumitoshi UKAI
2001-11-27 18:23:33 +00:00
parent 5f6668127e
commit 0369c273f2
6 changed files with 53 additions and 32 deletions
+13
View File
@@ -1,3 +1,16 @@
2001-11-28 Fumitoshi UKAI <ukai@debian.or.jp>
* [w3m-dev 02578]
* file.c (process_anchor): support <input type="image">
* html.c (ALST_INPUT): add ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT
* html.c (MAXA_INPUT): +3
* conv.c (checkShiftCode): fix comments for indent(1)
* main.c (loadLink): ditto
* fm.h: ditto
* file.c (process_anchor); ditto
* file.c (HTMLlineproc2body): ditto
2001-11-28 Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
* [w3m-dev 02576]
+3 -5
View File
@@ -1,4 +1,4 @@
/* $Id: conv.c,v 1.4 2001/11/24 02:01:26 ukai Exp $ */
/* $Id: conv.c,v 1.5 2001/11/27 18:23:33 ukai Exp $ */
#include <stdio.h>
#include <string.h>
#include "fm.h"
@@ -565,8 +565,7 @@ checkShiftCode(Str buf, uchar hint)
case EUC_NOSTATE:
if (!(*p & 0x80)) /* ASCII */
;
else if (0xa1 <= *p && *p <= 0xfe) /* JIS X 0208,
* * * * * 0213-1 */
else if (0xa1 <= *p && *p <= 0xfe) /* JIS X 0208, 0213-1 */
euc = (CODE_STATE(euc) | EUC_MBYTE1);
else if (*p == EUC_SS2_CODE) /* SS2 + JIS X 0201-Kana */
euc = (CODE_STATE(euc) | EUC_SS2);
@@ -625,8 +624,7 @@ checkShiftCode(Str buf, uchar hint)
case SJIS_SHIFT_H:
if (CODE_STATE(sjis) == CODE_NORMAL)
sjis = CODE_OK;
if ((0x40 <= *p && *p <= 0x7e) || (0x80 <= *p && *p <= 0xfc)) /* JIS X 0208,
* * * * * 0213 */
if ((0x40 <= *p && *p <= 0x7e) || (0x80 <= *p && *p <= 0xfc)) /* JIS X 0208, 0213 */
sjis = (CODE_STATE(sjis) | SJIS_NOSTATE);
else if (sjis & CODE_BROKEN)
sjis = CODE_ERROR;
+27 -15
View File
@@ -1,4 +1,4 @@
/* $Id: file.c,v 1.15 2001/11/25 17:41:57 ukai Exp $ */
/* $Id: file.c,v 1.16 2001/11/27 18:23:33 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -2324,8 +2324,9 @@ process_anchor(struct parsed_tag *tag, char *tagbuf)
Str
process_input(struct parsed_tag *tag)
{
int i, w, v, x, y, z;
int i, w, v, x, y, z, iw, ih;
char *q, *p, *r, *p2;
char *pi = NULL;
Str tmp;
char *qq = "";
int qlen = 0;
@@ -2360,10 +2361,11 @@ process_input(struct parsed_tag *tag)
case FORM_INPUT_RESET:
q = "RESET";
break;
/* if no VALUE attribute is specified in * <INPUT
* TYPE=CHECKBOX> tag, then the value "on" is used * as a
* default value. It is not a part of HTML4.0 * specification,
* but an imitation of Netscape * behaviour. */
/* if no VALUE attribute is specified in
* <INPUT TYPE=CHECKBOX> tag, then the value "on" is used
* as a default value. It is not a part of HTML4.0
* specification, but an imitation of Netscape behaviour.
*/
case FORM_INPUT_CHECKBOX:
q = "on";
}
@@ -2434,20 +2436,31 @@ process_input(struct parsed_tag *tag)
}
break;
case FORM_INPUT_IMAGE:
parsedtag_get_value(tag, ATTR_SRC, &pi);
if (pi) {
Strcat(tmp, Sprintf("<img_alt src=\"%s\"", html_quote(pi)));
if (parsedtag_get_value(tag, ATTR_WIDTH, &iw))
Strcat(tmp, Sprintf(" width=\"%d\"", iw));
if (parsedtag_get_value(tag, ATTR_HEIGHT, &ih))
Strcat(tmp, Sprintf(" height=\"%d\"", ih));
Strcat_charp(tmp, ">");
if (p2)
Strcat_charp(tmp, html_quote(p2));
else
Strcat_charp(tmp, qq);
Strcat_charp(tmp, "</img_alt>");
break;
}
/* FALL THROUGH */
case FORM_INPUT_SUBMIT:
case FORM_INPUT_BUTTON:
if (p2) {
if (p2)
Strcat_charp(tmp, html_quote(p2));
i = strlen(p2);
}
else {
else
Strcat_charp(tmp, qq);
i = qlen;
}
break;
case FORM_INPUT_RESET:
Strcat_charp(tmp, qq);
i = qlen;
break;
case FORM_INPUT_RADIO:
case FORM_INPUT_CHECKBOX:
@@ -3963,8 +3976,7 @@ HTMLlineproc2body(Buffer *buf, Str (*feed) (), int llimit)
/* nothing to do */
break;
case HTML_AREA:
if (buf->maplist == NULL) /* outside of *
* * * * * <map>..</map> */
if (buf->maplist == NULL) /* outside of <map>..</map> */
break;
if (parsedtag_get_value(tag, ATTR_HREF, &p)) {
p = remove_space(p);
+2 -2
View File
@@ -1,4 +1,4 @@
/* $Id: fm.h,v 1.21 2001/11/26 09:01:08 ukai Exp $ */
/* $Id: fm.h,v 1.22 2001/11/27 18:23:33 ukai Exp $ */
/*
* w3m: WWW wo Miru utility
*
@@ -10,7 +10,7 @@
#ifndef FM_H
#define FM_H
#define _GNU_SOURCE /* strcasestr() */
#define _GNU_SOURCE /* strcasestr() */
#include <stdio.h>
#include <stdlib.h>
+4 -3
View File
@@ -1,4 +1,4 @@
/* $Id: html.c,v 1.5 2001/11/24 02:01:26 ukai Exp $ */
/* $Id: html.c,v 1.6 2001/11/27 18:23:33 ukai Exp $ */
#include "html.h"
/* Define HTML Tag Infomation Table */
@@ -43,9 +43,10 @@ unsigned char ALST_FORM[] =
#define MAXA_FORM MAXA_CORE + 7
unsigned char ALST_INPUT[] =
{ ATTR_TYPE, ATTR_VALUE, ATTR_NAME, ATTR_CHECKED, ATTR_ACCEPT, ATTR_SIZE,
ATTR_MAXLENGTH, ATTR_ALT, ATTR_READONLY, ATTR_CORE
ATTR_MAXLENGTH, ATTR_ALT, ATTR_READONLY, ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT,
ATTR_CORE
};
#define MAXA_INPUT MAXA_CORE + 9
#define MAXA_INPUT MAXA_CORE + 12
unsigned char ALST_TEXTAREA[] =
{ ATTR_COLS, ATTR_ROWS, ATTR_NAME, ATTR_READONLY, ATTR_CORE };
#define MAXA_TEXTAREA MAXA_CORE + 4
+4 -7
View File
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.24 2001/11/27 04:45:28 ukai Exp $ */
/* $Id: main.c,v 1.25 2001/11/27 18:23:33 ukai Exp $ */
#define MAINPROGRAM
#include "fm.h"
#include <signal.h>
@@ -2362,12 +2362,9 @@ loadLink(char *url, char *target, char *referer, FormList *request)
if (do_download) /* download (thus no need to render frame) */
return loadNormalBuf(buf, FALSE);
if (target == NULL || /* no target specified (that means * this
* page is not a frame page) */
!strcmp(target, "_top") || /* this link is specified to * be
* opened as an indivisual * page */
!(Currentbuf->bufferprop & BP_FRAME) /* This page is not a *
* * * * * frame page */
if (target == NULL || /* no target specified (that means this page is not a frame page) */
!strcmp(target, "_top") || /* this link is specified to be opened as an indivisual * page */
!(Currentbuf->bufferprop & BP_FRAME) /* This page is not a frame page */
) {
return loadNormalBuf(buf, TRUE);
}