diff options
-rw-r--r-- | CHANGES | 12 | ||||
-rw-r--r-- | LYMessages_en.h | 6 | ||||
-rw-r--r-- | src/GridText.c | 16 | ||||
-rw-r--r-- | src/HTForms.h | 5 | ||||
-rw-r--r-- | src/HTML.c | 71 | ||||
-rw-r--r-- | src/LYForms.c | 8 | ||||
-rw-r--r-- | src/LYMain.c | 4 | ||||
-rw-r--r-- | userdefs.h | 8 |
8 files changed, 75 insertions, 55 deletions
diff --git a/CHANGES b/CHANGES index de41f953..5c1f4fbb 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,18 @@ --- $LynxId: CHANGES,v 1.407 2009/05/25 21:24:24 tom Exp $ +-- $LynxId: CHANGES,v 1.410 2009/05/29 00:20:08 tom Exp $ =============================================================================== Changes since Lynx 2.8 release =============================================================================== +2009-05-25 (2.8.7pre.5) +* remove "Bad HTML" warning for buttons outside a form, since those can be + inline, according to the HTML 4 DTD -TD +* provide navigation to script-buttons, to make them more visible, showing + their name -TD +* change default for send_useragent option to true (prompted by discussion on + lynx-dev) -TD +* correct check for default type of HTML BUTTON, which is "submit". The code + treated this as "button" (prompted by discussion on lynx-dev) -TD + 2009-05-25 (2.8.7pre.4) * update lynx.pot file -TD * fix a typo in change for Debian #388622 -TD diff --git a/LYMessages_en.h b/LYMessages_en.h index acd7bc5b..3ef4a112 100644 --- a/LYMessages_en.h +++ b/LYMessages_en.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYMessages_en.h,v 1.69 2008/12/26 22:20:58 tom Exp $ + * $LynxId: LYMessages_en.h,v 1.70 2009/05/28 23:11:50 tom Exp $ * * Lynx - Hypertext navigation system * @@ -130,6 +130,10 @@ gettext("(Form reset button) Use right-arrow or <return> to reset form to defaults.") #define FORM_LINK_RESET_DIS_MSG \ gettext("DISABLED form reset button. Use UP or DOWN arrows or tab to move off.") +#define FORM_LINK_BUTTON_MESSAGE \ + gettext("(Script button) Use UP or DOWN arrows or tab to move off.") +#define FORM_LINK_BUTTON_DIS_MSG \ + gettext("DISABLED Script button. Use UP or DOWN arrows or tab to move off.") #define FORM_LINK_OPTION_LIST_MESSAGE \ gettext("(Option list) Hit return and use arrow keys and return to select option.") #define CHOICE_LIST_MESSAGE \ diff --git a/src/GridText.c b/src/GridText.c index a36875ea..e45755df 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -1,5 +1,5 @@ /* - * $LynxId: GridText.c,v 1.167 2009/04/26 13:05:17 tom Exp $ + * $LynxId: GridText.c,v 1.170 2009/05/29 00:04:24 tom Exp $ * * Character grid hypertext object * =============================== @@ -6117,6 +6117,9 @@ void HText_FormDescNumber(int number, case F_RESET_TYPE: *desc = gettext("reset button"); return; + case F_BUTTON_TYPE: + *desc = gettext("script button"); + return; case F_OPTION_LIST_TYPE: *desc = gettext("popup menu"); return; @@ -9854,6 +9857,8 @@ int HText_beginInput(HText *text, BOOL underline, CTRACE((tfp, "ok, got a file uploader\n")); } else if (!strcasecomp(I->type, "keygen")) { f->type = F_KEYGEN_TYPE; + } else if (!strcasecomp(I->type, "button")) { + f->type = F_BUTTON_TYPE; } else { /* * Note that TYPE="scribble" defaults to TYPE="text". -FM @@ -9938,6 +9943,13 @@ int HText_beginInput(HText *text, BOOL underline, StrAllocCopy(f->value, "Reset"); f->size = 5; } + } else if (f->type == F_BUTTON_TYPE) { + if (non_empty(f->value)) { + f->size = strlen(f->value); + } else { + StrAllocCopy(f->value, "BUTTON"); + f->size = 5; + } } else if (f->type == F_IMAGE_SUBMIT_TYPE || f->type == F_SUBMIT_TYPE) { if (non_empty(f->value)) { @@ -10003,6 +10015,7 @@ int HText_beginInput(HText *text, BOOL underline, #endif case F_RANGE_TYPE: case F_KEYGEN_TYPE: + case F_BUTTON_TYPE: a->number = 0; break; @@ -11410,6 +11423,7 @@ int HText_SubmitForm(FormInfo * submit_item, DocInfo *doc, char *link_name, break; #endif /* USE_FILE_UPLOAD */ case F_KEYGEN_TYPE: + case F_BUTTON_TYPE: /* not implemented */ break; } diff --git a/src/HTForms.h b/src/HTForms.h index de4ae372..ec994051 100644 --- a/src/HTForms.h +++ b/src/HTForms.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTForms.h,v 1.26 2008/09/07 16:35:26 tom Exp $ + * $LynxId: HTForms.h,v 1.27 2009/05/28 22:49:51 tom Exp $ */ #ifndef HTFORMS_H #define HTFORMS_H @@ -133,7 +133,8 @@ extern "C" { F_FILE_TYPE, F_TEXT_SUBMIT_TYPE, F_IMAGE_SUBMIT_TYPE, - F_KEYGEN_TYPE + F_KEYGEN_TYPE, + F_BUTTON_TYPE } FieldTypes; #define F_TEXTLIKE(type) ((type) == F_TEXT_TYPE || \ diff --git a/src/HTML.c b/src/HTML.c index 007f3a4e..eaca6ad7 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTML.c,v 1.122 2009/05/25 19:53:35 tom Exp $ + * $LynxId: HTML.c,v 1.126 2009/05/29 00:24:15 tom Exp $ * * Structured stream to Rich hypertext converter * ============================================ @@ -4316,35 +4316,24 @@ static int HTML_start_element(HTStructured * me, int element_number, I.value_cs = ATTR_CS_IN; UPDATE_STYLE; - if ((present && present[HTML_BUTTON_TYPE] && - value[HTML_BUTTON_TYPE]) && - (!strcasecomp(value[HTML_BUTTON_TYPE], "submit") || - !strcasecomp(value[HTML_BUTTON_TYPE], "reset"))) { - /* - * It's a button for submitting or resetting a form. - FM - */ - I.type = value[HTML_BUTTON_TYPE]; + if (present && + present[HTML_BUTTON_TYPE] && + value[HTML_BUTTON_TYPE]) { + if (!strcasecomp(value[HTML_BUTTON_TYPE], "submit") || + !strcasecomp(value[HTML_BUTTON_TYPE], "reset")) { + /* + * It's a button for submitting or resetting a form. - FM + */ + I.type = value[HTML_BUTTON_TYPE]; + } else { + /* + * Ugh, it's a button for a script. - FM + */ + I.type = value[HTML_BUTTON_TYPE]; + } } else { - /* - * Ugh, it's a button for a script. - FM - */ - HTML_put_string(me, " [BUTTON] "); - break; - } - - /* - * Make sure we're in a form. - */ - if (!me->inFORM) { - if (LYBadHTML(me)) - CTRACE((tfp, - "Bad HTML: BUTTON tag not within FORM tag\n")); - /* - * We'll process it, since the chances of a crash are small, - * and we probably do have a form started. - FM - * - break; - */ + /* default, if no type given, is a submit button */ + I.type = "submit"; } /* @@ -4391,6 +4380,12 @@ static int HTML_start_element(HTStructured * me, int element_number, * trailing spaces. - FM */ LYReduceBlanks(I.value); + } else if (!strcasecomp(I.type, "button")) { + if (!isEmpty(I.name)) { + StrAllocCopy(I.value, I.name); + } else { + StrAllocCopy(I.value, "BUTTON"); + } } if (present && present[HTML_BUTTON_DISABLED]) @@ -4550,8 +4545,7 @@ static int HTML_start_element(HTStructured * me, int element_number, /* * Ugh, a button for a script. */ - HTML_put_string(me, "[BUTTON] "); - break; + not_impl = "[BUTTON Input]"; } if (not_impl != NULL) { if (me->inUnderline == FALSE) { @@ -4572,21 +4566,6 @@ static int HTML_start_element(HTStructured * me, int element_number, } } - /* - * Check if we're in a form. - FM - */ - if (!me->inFORM) { - if (LYBadHTML(me)) - CTRACE((tfp, - "Bad HTML: INPUT tag not within FORM tag\n")); - /* - * We'll process it, since the chances of a crash are small, - * and we probably do have a form started. - FM - * - break; - */ - } - CTRACE((tfp, "Ok, we're trying type=[%s]\n", NONNULL(I.type))); /* diff --git a/src/LYForms.c b/src/LYForms.c index 1e3b5af8..d6ea2fe9 100644 --- a/src/LYForms.c +++ b/src/LYForms.c @@ -1,4 +1,4 @@ -/* $LynxId: LYForms.c,v 1.80 2009/01/01 23:21:07 tom Exp $ */ +/* $LynxId: LYForms.c,v 1.81 2009/05/28 23:10:06 tom Exp $ */ #include <HTUtils.h> #include <HTCJK.h> #include <HTTP.h> @@ -982,6 +982,12 @@ void show_formlink_statusline(const FormInfo * form, else statusline(FORM_LINK_RESET_MESSAGE); break; + case F_BUTTON_TYPE: + if (form->disabled == YES) + statusline(FORM_LINK_BUTTON_DIS_MSG); + else + statusline(FORM_LINK_BUTTON_MESSAGE); + break; case F_FILE_TYPE: if (form->disabled == YES) statusline(FORM_LINK_FILE_UNM_MSG); diff --git a/src/LYMain.c b/src/LYMain.c index 1f12fcfe..e7c6d767 100644 --- a/src/LYMain.c +++ b/src/LYMain.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMain.c,v 1.201 2009/05/22 00:18:53 tom Exp $ + * $LynxId: LYMain.c,v 1.202 2009/05/28 21:37:03 tom Exp $ */ #include <HTUtils.h> #include <HTTP.h> @@ -372,7 +372,7 @@ BOOLEAN LYNoRefererForThis = FALSE; /* No Referer header for this URL? */ BOOLEAN LYNoRefererHeader = FALSE; /* Never send Referer header? */ BOOLEAN LYRawMode; BOOLEAN LYSelectPopups = USE_SELECT_POPUPS; -BOOLEAN LYSendUserAgent = FALSE; /* send Lynx User-Agent header? */ +BOOLEAN LYSendUserAgent = SEND_USERAGENT; /* send Lynx User-Agent header? */ BOOLEAN LYSetCookies = SET_COOKIES; /* Process Set-Cookie headers? */ BOOLEAN LYUseDefSelPop = TRUE; /* Command line -popup toggle */ BOOLEAN LYUseDefaultRawMode = TRUE; diff --git a/userdefs.h b/userdefs.h index 103b0454..c8f39939 100644 --- a/userdefs.h +++ b/userdefs.h @@ -1,5 +1,5 @@ /* - * $LynxId: userdefs.h,v 1.245 2009/05/26 00:36:19 tom Exp $ + * $LynxId: userdefs.h,v 1.246 2009/05/28 21:37:22 tom Exp $ * * Lynx - Hypertext navigation system * @@ -892,6 +892,12 @@ */ #define SET_COOKIES TRUE +/******************************** + * If SEND_USERAGENT is set FALSE, Lynx will not send a user-agent string. + * You can override this in the 'O'ptions menu. + */ +#define SEND_USERAGENT TRUE + /******************************* * If ACCEPT_ALL_COOKIES is set TRUE, and SET_COOKIES is TRUE, Lynx will * accept all cookies. |