commit 053ace4e2762b0d352153cbf8af6f3890038b7ab
parent 2ed35f5841195b27ce810441fb9edfbb0808852d
Author: ukai <ukai>
Date: Tue, 27 Nov 2001 18:23:33 +0000
[w3m-dev 02578]
From: Fumitoshi UKAI <ukai@debian.or.jp>
<input type="image">
Diffstat:
6 files changed, 48 insertions(+), 27 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -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]
diff --git a/conv.c b/conv.c
@@ -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;
diff --git a/file.c b/file.c
@@ -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);
diff --git a/fm.h b/fm.h
@@ -10,7 +10,7 @@
#ifndef FM_H
#define FM_H
-#define _GNU_SOURCE /* strcasestr() */
+#define _GNU_SOURCE /* strcasestr() */
#include <stdio.h>
#include <stdlib.h>
diff --git a/html.c b/html.c
@@ -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
diff --git a/main.c b/main.c
@@ -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);
}