[w3m-dev 03991] iframe patch

rubikitch <[email protected]>
Newsgroups gmane.comp.web.w3m.devel
Message-ID <[email protected]>

iframe

MAXA_IFRAME(^^;

w3m-0.4.2

 $ diff -u w3m-0.4.2 w3m-0.4.2-iframe
diff -u w3m-0.4.2/file.c w3m-0.4.2-iframe/file.c
--- w3m-0.4.2/file.c	2003-08-29 23:49:46.000000000 +0900
+++ w3m-0.4.2-iframe/file.c	2003-10-14 06:27:10.000000000 +0900
@@ -4909,6 +4909,16 @@
 	    }
 	}
 	return 1;
+    case HTML_IFRAME:
+	if (view_unseenobject) {
+	    if (parsedtag_get_value(tag, ATTR_SRC, &p)) {
+		Str s;
+		q = html_quote(p);
+		s = Sprintf("<A HREF=\"%s\">iframe(%s)</A>", q, q);
+		HTMLlineproc1(s->ptr, h_env);
+	    }
+	}
+	return 1;
     case HTML_BODY:
 	if (view_unseenobject) {
 	    if (parsedtag_get_value(tag, ATTR_BACKGROUND, &p)) {
diff -u w3m-0.4.2/html.c w3m-0.4.2-iframe/html.c
--- w3m-0.4.2/html.c	2003-08-12 02:33:08.000000000 +0900
+++ w3m-0.4.2-iframe/html.c	2003-10-14 06:27:10.000000000 +0900
@@ -88,6 +88,9 @@
 unsigned char ALST_EMBED[] = { ATTR_SRC, ATTR_CORE };
 #define MAX_EMBED	MAXA_CORE + 1
 
+unsigned char ALST_IFRAME[] = { ATTR_SRC, ATTR_CORE };
+#define MAXA_IFRAME	MAXA_CORE + 1
+
 unsigned char ALST_TEXTAREA_INT[] = { ATTR_TEXTAREANUMBER };
 #define MAXA_TEXTAREA_INT 1
 unsigned char ALST_SELECT_INT[] = { ATTR_SELECTNUMBER };
@@ -230,11 +233,11 @@
     {"/s", NULL, 0, TFLG_END},	/*  106 HTML_N_S      */
     {"q", NULL, 0, 0},		/*  107 HTML_Q */
     {"/q", NULL, 0, TFLG_END},	/*  108 HTML_N_Q */
-    {NULL, NULL, 0, 0},		/* 109 Undefined       */
+    {"iframe", ALST_IFRAME, MAXA_IFRAME, 0},     /*  109 HTML_IFRAME */
+    {"/iframe", NULL, 0, TFLG_END}, /* 110 HTML_N_IFRAME */
+    {NULL, NULL, 0, 0},		/* 111 Undefined       */
 
     /* pseudo tag */
-    {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT},	/* 110 HTML_SELECT_INT   */
-    {"/select_int", NULL, 0, TFLG_INT | TFLG_END},	/* 111 HTML_N_SELECT_INT */
     {"option_int", ALST_OPTION, MAXA_OPTION, TFLG_INT},	/* 112 HTML_OPTION_INT   */
     {"textarea_int", ALST_TEXTAREA_INT, MAXA_TEXTAREA_INT, TFLG_INT},	/* 113 HTML_TEXTAREA_INT   */
     {"/textarea_int", NULL, 0, TFLG_INT | TFLG_END},	/* 114 HTML_N_TEXTAREA_INT */
@@ -258,6 +261,9 @@
     {"/internal", NULL, 0, TFLG_INT | TFLG_END},	/* 132 HTML_N_INTERNAL   */
     {"div_int", ALST_P, MAXA_P, TFLG_INT},	/*  133 HTML_DIV_INT    */
     {"/div_int", NULL, 0, TFLG_INT | TFLG_END},	/*  134 HTML_N_DIV_INT  */
+    {"select_int", ALST_SELECT_INT, MAXA_SELECT_INT, TFLG_INT},	/* 135 HTML_SELECT_INT   */
+    {"/select_int", NULL, 0, TFLG_INT | TFLG_END},	/* 136 HTML_N_SELECT_INT */
+
 };
 
 TagAttrInfo AttrMAP[MAX_TAGATTR] = {
diff -u w3m-0.4.2/html.h w3m-0.4.2-iframe/html.h
--- w3m-0.4.2/html.h	2003-04-19 01:47:18.000000000 +0900
+++ w3m-0.4.2-iframe/html.h	2003-10-14 06:27:11.000000000 +0900
@@ -197,10 +197,11 @@
 #define HTML_N_S        106
 #define HTML_Q		107
 #define HTML_N_Q	108
+#define HTML_IFRAME     109
+#define HTML_N_IFRAME     110
+
 
    /* pseudo tag */
-#define HTML_SELECT_INT     110
-#define HTML_N_SELECT_INT   111
 #define HTML_OPTION_INT     112
 #define HTML_TEXTAREA_INT   113
 #define HTML_N_TEXTAREA_INT 114
@@ -224,8 +225,10 @@
 #define HTML_N_INTERNAL     132
 #define HTML_DIV_INT        133
 #define HTML_N_DIV_INT      134
+#define HTML_SELECT_INT     135
+#define HTML_N_SELECT_INT   136
 
-#define MAX_HTMLTAG	    135
+#define MAX_HTMLTAG	    137
 
 /* Tag attribute */
 
diff -u w3m-0.4.2/tagtable.tab w3m-0.4.2-iframe/tagtable.tab
--- w3m-0.4.2/tagtable.tab	2003-04-19 01:47:18.000000000 +0900
+++ w3m-0.4.2-iframe/tagtable.tab	2003-10-14 06:27:11.000000000 +0900
@@ -161,6 +161,8 @@
 bgsound		HTML_BGSOUND
 applet		HTML_APPLET
 embed		HTML_EMBED
+iframe          HTML_IFRAME
+/iframe         HTML_N_IFRAME
 internal	HTML_INTERNAL
 /internal	HTML_N_INTERNAL
 select_int	HTML_SELECT_INT


http://www.rubyist.net/~rubikitch/ Ruby
http://www.rubyist.net/~rubikitch/computer/irbshbook/ irbsh
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.