diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/html.cc | 30 |
2 files changed, 30 insertions, 1 deletions
@@ -94,6 +94,7 @@ dillo-fltk2 - Implemented ISINDEX. - Added input image for FORMS. - Added button for FORMS. + - Added nesting checks for BUTTON, SELECT and FORM. Patches: place +- Fixed a problem with locally-installed dpis. - Added code for optional image loading (nice interface) very advanced! diff --git a/src/html.cc b/src/html.cc index a6611f52..1cd9eb33 100644 --- a/src/html.cc +++ b/src/html.cc @@ -2572,6 +2572,12 @@ static void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize) MSG_HTML("<button> element outside <form>\n"); return; } + if (html->InFlags & IN_BUTTON) { + MSG_HTML("nested <button>\n"); + return; + } + html->InFlags |= IN_BUTTON; + form = html->forms->getRef (html->forms->size() - 1); type = Html_get_attr_wdef(html, tag, tagsize, "type", ""); @@ -2635,6 +2641,15 @@ static void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize) } /* + * Handle close <BUTTON> + */ +static void Html_tag_close_button(DilloHtml *html, int TagIdx) +{ + html->InFlags &= ~IN_BUTTON; + Html_pop_tag(html, TagIdx); +} + +/* * <FONT> */ static void Html_tag_open_font(DilloHtml *html, const char *tag, int tagsize) @@ -4492,6 +4507,14 @@ static void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize) MSG_HTML("<input> element outside <form>\n"); return; } + if (html->InFlags & IN_SELECT) { + MSG_HTML("<input> element inside <select>\n"); + return; + } + if (html->InFlags & IN_BUTTON) { + MSG_HTML("<input> element inside <button>\n"); + return; + } form = html->forms->getRef (html->forms->size() - 1); @@ -4664,6 +4687,11 @@ static void Html_tag_open_isindex(DilloHtml *html, Embed *embed; const char *attrbuf; + if (html->InFlags & IN_FORM) { + MSG("<isindex> inside <form> not handled.\n"); + return; + } + if ((attrbuf = Html_get_attr(html, tag, tagsize, "action"))) action = Html_url_new(html, attrbuf, NULL, 0, 0, 0, 0); else @@ -5160,7 +5188,7 @@ const TagInfo Tags[] = { {"blockquote", B8(011110),'R',2,Html_tag_open_blockquote,Html_tag_close_par}, {"body", B8(011110),'O',1, Html_tag_open_body, Html_tag_close_body}, {"br", B8(010001),'F',0, Html_tag_open_br, Html_tag_close_default}, - {"button", B8(011101),'R',2, Html_tag_open_button, Html_tag_close_default}, + {"button", B8(011101),'R',2, Html_tag_open_button, Html_tag_close_button}, /* caption */ {"center", B8(011110),'R',2, Html_tag_open_center, Html_tag_close_div}, {"cite", B8(010101),'R',2, Html_tag_open_cite, Html_tag_close_default}, |