aboutsummaryrefslogtreecommitdiff
path: root/src/form.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/form.cc')
-rw-r--r--src/form.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/src/form.cc b/src/form.cc
index 07c12815..9e7dc4f6 100644
--- a/src/form.cc
+++ b/src/form.cc
@@ -343,7 +343,7 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
HT2TB(html)->addParbreak (9, html->wordStyle ());
if (html->InFlags & IN_FORM) {
- BUG_MSG("nested forms\n");
+ BUG_MSG("Nested <form>.");
return;
}
html->InFlags |= IN_FORM;
@@ -356,14 +356,14 @@ void Html_tag_open_form(DilloHtml *html, const char *tag, int tagsize)
if (!dStrAsciiCasecmp(attrbuf, "post")) {
method = DILLO_HTML_METHOD_POST;
} else if (dStrAsciiCasecmp(attrbuf, "get")) {
- BUG_MSG("Unknown form submission method \"%s\"\n", attrbuf);
+ BUG_MSG("<form> submission method unknown: '%s'.", attrbuf);
}
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "action")))
action = a_Html_url_new(html, attrbuf, NULL, 0);
else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("action attribute is required for <form>\n");
+ BUG_MSG("<form> requires action attribute.");
action = a_Url_dup(html->base_url);
}
content_type = DILLO_HTML_ENC_URLENCODED;
@@ -417,7 +417,7 @@ static int Html_input_get_size(DilloHtml *html, const char *attrbuf)
if (size < 1 || size > MAX_SIZE) {
int badSize = size;
size = (size < 1 ? 20 : MAX_SIZE);
- BUG_MSG("input size=%d, using size=%d instead\n", badSize, size);
+ BUG_MSG("<input> size=%d, using size=%d instead.", badSize, size);
}
}
return size;
@@ -437,11 +437,11 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
ResourceFactory *factory;
if (html->InFlags & IN_SELECT) {
- BUG_MSG("<input> element inside <select>\n");
+ BUG_MSG("<input> inside <select>.");
return;
}
if (html->InFlags & IN_BUTTON) {
- BUG_MSG("<input> element inside <button>\n");
+ BUG_MSG("<input> inside <button>.");
return;
}
@@ -507,12 +507,12 @@ void Html_tag_open_input(DilloHtml *html, const char *tag, int tagsize)
DilloHtmlForm *form = html->getCurrentForm();
if (form->method != DILLO_HTML_METHOD_POST) {
valid = false;
- BUG_MSG("Forms with file input MUST use HTTP POST method\n");
+ BUG_MSG("<form> with file input MUST use HTTP POST method.");
MSG("File input ignored in form not using HTTP POST method\n");
} else if (form->content_type != DILLO_HTML_ENC_MULTIPART) {
valid = false;
- BUG_MSG("Forms with file input MUST use multipart/form-data"
- " encoding\n");
+ BUG_MSG("<form> with file input MUST use multipart/form-data"
+ " encoding.");
MSG("File input ignored in form not using multipart/form-data"
" encoding\n");
}
@@ -641,25 +641,25 @@ void Html_tag_content_textarea(DilloHtml *html, const char *tag, int tagsize)
cols = strtol(attrbuf, NULL, 10);
} else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("cols attribute is required for <textarea>\n");
+ BUG_MSG("<textarea> requires cols attribute.");
cols = 20;
}
if (cols < 1 || cols > MAX_COLS) {
int badCols = cols;
cols = (cols < 1 ? 20 : MAX_COLS);
- BUG_MSG("textarea cols=%d, using cols=%d instead\n", badCols, cols);
+ BUG_MSG("<textarea> cols=%d, using cols=%d instead.", badCols, cols);
}
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "rows"))) {
rows = strtol(attrbuf, NULL, 10);
} else {
if (html->DocType != DT_HTML || html->DocTypeVersion <= 4.01f)
- BUG_MSG("rows attribute is required for <textarea>\n");
+ BUG_MSG("<textarea> requires rows attribute.");
rows = 10;
}
if (rows < 1 || rows > MAX_ROWS) {
int badRows = rows;
rows = (rows < 1 ? 2 : MAX_ROWS);
- BUG_MSG("textarea rows=%d, using rows=%d instead\n", badRows, rows);
+ BUG_MSG("<textarea> rows=%d, using rows=%d instead.", badRows, rows);
}
name = NULL;
if ((attrbuf = a_Html_get_attr(html, tag, tagsize, "name")))
@@ -799,11 +799,11 @@ void Html_tag_close_select(DilloHtml *html)
void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize)
{
if (!(html->InFlags & IN_SELECT)) {
- BUG_MSG("<optgroup> element outside <select>\n");
+ BUG_MSG("<optgroup> outside <select>.");
return;
}
if (html->InFlags & IN_OPTGROUP) {
- BUG_MSG("nested <optgroup>\n");
+ BUG_MSG("Nested <optgroup>.");
return;
}
if (html->InFlags & IN_OPTION) {
@@ -821,7 +821,7 @@ void Html_tag_open_optgroup(DilloHtml *html, const char *tag, int tagsize)
bool enabled = (a_Html_get_attr(html, tag, tagsize, "disabled") == NULL);
if (!label) {
- BUG_MSG("label attribute is required for <optgroup>\n");
+ BUG_MSG("<optgroup> requires label attribute.");
label = strdup("");
}
@@ -859,7 +859,7 @@ void Html_tag_close_optgroup(DilloHtml *html)
void Html_tag_open_option(DilloHtml *html, const char *tag, int tagsize)
{
if (!(html->InFlags & IN_SELECT)) {
- BUG_MSG("<option> element outside <select>\n");
+ BUG_MSG("<option> outside <select>.");
return;
}
if (html->InFlags & IN_OPTION)
@@ -918,7 +918,7 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
inp_type = DILLO_HTML_INPUT_BUTTON_SUBMIT;
} else {
inp_type = DILLO_HTML_INPUT_UNKNOWN;
- BUG_MSG("Unknown button type: \"%s\"\n", type);
+ BUG_MSG("<button> type unknown: '%s'.", type);
}
if (inp_type != DILLO_HTML_INPUT_UNKNOWN) {
@@ -945,9 +945,7 @@ void Html_tag_open_button(DilloHtml *html, const char *tag, int tagsize)
embed = new Embed(resource);
// a_Dw_button_set_sensitive (DW_BUTTON (button), FALSE);
- HT2TB(html)->addParbreak (5, html->wordStyle ());
HT2TB(html)->addWidget (embed, html->backgroundStyle ());
- HT2TB(html)->addParbreak (5, html->wordStyle ());
S_TOP(html)->textblock = html->dw = page;